Squirrel/Server/Functions/Vehicles/IdleTime

From Liberty Unleashed Wiki
Revision as of 14:46, 8 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

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