Squirrel/Client/Functions/Players/Ping

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Squirrel/Title|Player.Ping}} This ''Player'' class member returns the player's current ping. == Syntax == <code>int Player.Ping</code> == Arguments == * '''none''' == ...")
 
 
Line 15: Line 15:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 +
pPlayer <- FindLocalPlayer();
 +
 
function onClientCommand( cmd, text )
 
function onClientCommand( cmd, text )
 
{
 
{

Latest revision as of 11:04, 4 March 2015

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Player class member returns the player's current ping.

[edit] Syntax

  1. int Player.Ping

[edit] Arguments

  • none

[edit] Example

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

  1.  
  2. pPlayer <- FindLocalPlayer();
  3.  
  4. function onClientCommand( cmd, text )
  5. {
  6. if ( cmd == "myping" )
  7. {
  8. Message( "Your ping: " + pPlayer.Ping);
  9. }
  10. return 1;
  11. }
  12.  

[edit] Notes

The function Message and call onClientCommand were used in in this example. More info about them in corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox