Vehicle.IdleTime

From Liberty Unleashed Wiki
Revision as of 11:07, 11 October 2010 by VRocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Vehicle class member returns how long (in milliseconds) the given vehicle has been unused.

Syntax

  1. int Vehicle.IdleTime

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "vehidletime" )
  5. {
  6. if ( text )
  7. {
  8. local veh = FindVehicle( text.tointeger() );
  9. if ( veh ) MessagePlayer( "Vehicle ID: " + text + " has been idle for " + ( veh.IdleTime() / 1000 ) + " seconds.", player );
  10. }
  11. }
  12. }
  13.  

This command will show how long the given vehicle id has been idle for in seconds.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox