Squirrel/Server/Functions/Vehicles/IdleTime

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Vehicle.IdleTime}}
 
This ''Vehicle'' class member returns how long (in milliseconds) the given vehicle has been unused.
 
This ''Vehicle'' class member returns how long (in milliseconds) the given vehicle has been unused.
  

Latest revision as of 11:07, 11 October 2010

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.

[edit] Syntax

  1. int Vehicle.IdleTime

[edit] Arguments

  • none

[edit] 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.

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox