GetPlayerPing

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 04:15, 5 February 2014
Connor Mead (Talk | contribs)

← Previous diff
Current revision
MP2 (Talk | contribs)

Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Description|Get the ping of a player.}}+{{Description|Get the [http://en.wikipedia.org/wiki/Ping_%28networking_utility%29 ping] of a player. The ping measures the amount of time it takes for the server to 'ping' the client and for the client to send the message back.}}
{{Parameters|playerid}} {{Parameters|playerid}}

Current revision



Description:

Get the ping of a player. The ping measures the amount of time it takes for the server to 'ping' the client and for the client to send the message back.


Parameters:
(playerid)
playeridThe ID of the player to get the ping of.


Return Values:

The current ping of the player (expressed in milliseconds).


public pingchecktimer(playerid)
{
    // Kick players with a high ping
    if(GetPlayerPing(playerid) > 1000) Kick(playerid);
    return 1;
}
Image:32px-Circle-style-warning.png

Important
Note

Player's ping may be 65535 for a while after a player connects


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages