GetNetworkStats
From SA-MP Wiki
(Difference between revisions)
Revision as of 08:11, 28 January 2014 Smithy (Talk | contribs) ← Previous diff |
Revision as of 16:31, 3 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 49: | Line 49: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
[[Category:NetStats_Functions]] | [[Category:NetStats_Functions]] | ||
+ | |||
+ | [[fr:GetNetworkStats]] |
Revision as of 16:31, 3 February 2014
Description:
Gets the server's network stats and stores them in a string.
(retstr[], retstr_size)
retstr[] | The string to store the network stats in, passed by reference. |
retstr_size | The length of the string to be stored. |
public OnPlayerCommandText(playerid,cmdtext[]) { if(!strcmp(cmdtext, "/netstats")) { new stats[400+1]; GetNetworkStats(stats, sizeof(stats)); // get the servers networkstats ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Server Network Stats", stats, "Close", ""); } return 1; }
Example output
Server Ticks: 200 Messages in Send buffer: 0 Messages sent: 142 Bytes sent: 8203 Acks sent: 11 Acks in send buffer: 0 Messages waiting for ack: 0 Messages resent: 0 Bytes resent: 0 Packetloss: 0.0% Messages received: 54 Bytes received: 2204 Acks received: 0 Duplicate acks received: 0 Inst. KBits per second: 28.8 KBits per second sent: 10.0 KBits per second received: 2.7
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetPlayerNetworkStats: Gets a player networkstats and saves it into a string.