Squirrel/Server/Functions/Players/IdleTime

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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events
This function currently does not work.

This function returns the player's Idle Time in ticks.

Syntax

  1. int player.IdleTime

Example

This command gives the player's Idle Time when someone types '/idletime <playername>'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "idletime" )
  5. {
  6. local pPlr;
  7. if ( szText )
  8. {
  9. pPlr = FindPlayer( szText );
  10. if ( pPlr ) MessagePlayer( pPlr.Name + "'s Idle Time is currently " + pPlr.IdleTime + " ticks.", pPlayer );
  11. else MessagePlayer( "Unknown player!", pPlayer );
  12. }
  13. else MessagePlayer( "Your Idle Time is currently " + pPlayer.IdleTime + " ticks.", pPlayer );
  14. }
  15. return 1;
  16. }
  17.  

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.

Related Functions

Template:Squirrel/Functions/Players

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox