Squirrel/Server/Functions/Players/Ping

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(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

  1. int player.Ping

Example

This command tells player their ping when they type '/myping'.

  1.  
  2. function OnPlayerCommand( pPlayer, cmd, text )
  3. {
  4. if ( cmd == "myping" )
  5. {
  6. MessagePlayer( "Your ping: " + pPlayer.Ping, player );
  7. }
  8. }
  9.  

Notes

The functions MessagePlayer, GetPlayerName and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Template:Squirrel/Functions/Players

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox