Squirrel/Client/Functions/Players/Ping
From Liberty Unleashed Wiki
(Difference between revisions)
(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
This Player class member returns the player's current ping.
[edit] Syntax
int Player.Ping
[edit] Arguments
- none
[edit] Example
This command tells player their ping when they type '/myping'.
pPlayer <- FindLocalPlayer(); function onClientCommand( cmd, text ) { if ( cmd == "myping" ) { Message( "Your ping: " + pPlayer.Ping); } return 1; }
[edit] Notes
The function Message and call onClientCommand were used in in this example. More info about them in corresponding pages.
[edit] Related Functions
- FindLocalPlayer
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.Colour
- Player.Frozen
- Player.Health
- Player.ID
- Player.Immune
- Player.Island
- Player.Marker
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLimb
- Player.Score
- Player.Skin
- Player.Spawn
- Player.Team
- Player.Train
- Player.Vehicle
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.WeaponAmmo
- Player.WeaponState