Player.IdleTime

From Liberty Unleashed Wiki
Jump to: navigation, search
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

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox