Squirrel/Server/Functions/Players/Ping
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '__NOTOC__ This function returns player's Ping. == Syntax == <code>int player.Ping</code> == Example == This command tells player their ping when they type '/myping'. <code l…') |
Revision as of 19:09, 28 September 2010
This function returns player's Ping.
Syntax
int player.Ping
Example
This command tells player their ping when they type '/myping'.
function OnPlayerCommand( pPlayer, cmd, text ) { if ( cmd == "myping" ) { MessagePlayer( "Your ping: " + pPlayer.Ping, player ); } }
Notes
The functions MessagePlayer, GetPlayerName and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.