Squirrel/Server/Functions/Vehicles/IdleRespawnTime
From Liberty Unleashed Wiki
This Vehicle class member returns or sets the idle respawn time of the given vehicle. If the vehicle is unused longer than this time limit indicates, it will respawn.
Syntax
You can either return or set a new value using this member:
int Vehicle.IdleRespawnTime
Vehicle.IdleRespawnTime = int iTime
Arguments
- iTime - This is the new idle respawn time for the vehicle
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "vehrespawntime" ) { if ( player.Vehicle ) MessagePlayer( "Your vehicles respawn time is: " + player.Vehicle.IdleRespawnTime, player ); } }
This command will return the idle respawn time of the vehicle they are driving.
Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setvehidle" ) { if ( player.Vehicle ) player.Vehicle.IdleRespawnTime = 300000; } }
This command will set the idle respawn time of the vehicle they are driving to 5 minutes.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- CreateVehicle
- FindVehicle
- GetClosestVehicle
- GetVehicleCount
- GetVehicleHandlingData
- GetVehicleIDFromName
- GetVehicleName
- SetVehicleHandlingData
- Vehicle.Alpha
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.EngineDamage
- Vehicle.Explode
- Vehicle.Fix
- Vehicle.GetAddon
- Vehicle.GetPassenger
- Vehicle.GetHandlingData
- Vehicle.GetWheelStatus
- Vehicle.Health
- Vehicle.ID
- Vehicle.IdleRespawnTime
- Vehicle.IdleTime
- Vehicle.LightState
- Vehicle.Locked
- Vehicle.Marker
- Vehicle.MarkerScale
- Vehicle.MarkerSprite
- Vehicle.Model
- Vehicle.OneTime
- Vehicle.PassengerCount
- Vehicle.Pos
- Vehicle.Remove
- Vehicle.Respawn
- Vehicle.RespawnTime
- Vehicle.RGBColour1
- Vehicle.RGBColour2
- Vehicle.SetHandlingData
- Vehicle.SetWheelStatus
- Vehicle.SpawnAngle
- Vehicle.SpawnPos
- Vehicle.SetAddon
- Vehicle.SetEngineState
- Vehicle.SetRadio
- Vehicle.Siren
- Vehicle.SirenLight
- Vehicle.TaxiLight
- Vehicle.Velocity
- Vehicle.VirtualWorld
- Vehicle.Wrecked