Squirrel/Server/Functions/Players/IdleTime
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
{{Squirrel/Title|Player.IdleTime}} | {{Squirrel/Title|Player.IdleTime}} | ||
+ | {{Squirrel/NotWorking}} | ||
This function returns the player's Idle Time in ticks. | This function returns the player's Idle Time in ticks. | ||
Revision as of 10:54, 11 October 2010
This function currently does not work.
This function returns the player's Idle Time in ticks.
Syntax
int player.IdleTime
Example
This command gives the player's Idle Time when someone types '/idletime <playername>'.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "idletime" ) { local pPlr; if ( szText ) { pPlr = FindPlayer( szText ); if ( pPlr ) MessagePlayer( pPlr.Name + "'s Idle Time is currently " + pPlr.IdleTime + " ticks.", pPlayer ); else MessagePlayer( "Unknown player!", pPlayer ); } else MessagePlayer( "Your Idle Time is currently " + pPlayer.IdleTime + " ticks.", pPlayer ); } return 1; }
Notes
The functions MessagePlayer and FindPlayer and Player.Name and event onPlayerCommand were used in this example. More info about them in the corresponding pages.