Vehicle.IdleTime

From Liberty Unleashed Wiki

Jump to: navigation, search

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

Syntax

int Vehicle.IdleTime

Arguments

  • none

Example

function onPlayerCommand( player, cmd, text )
{
	if ( cmd == "vehidletime" )
	{
		if ( text )
		{
			local veh = FindVehicle( text.tointeger() );
			if ( veh ) MessagePlayer( "Vehicle ID: " + text + " has been idle for " + ( veh.IdleTime() / 1000 ) + " seconds.", player );
		}
	}
}

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