Squirrel/Server/Functions/Vehicles/IdleRespawnTime
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | {{Squirrel/Title|Vehicle. | + | {{Squirrel/Title|Vehicle.IdleRespawnTime}} |
This ''Vehicle'' class member returns or sets the idle respawn time of the given vehicle as seconds. If the vehicle is unused longer than this time limit indicates, it will respawn. | This ''Vehicle'' class member returns or sets the idle respawn time of the given vehicle as seconds. If the vehicle is unused longer than this time limit indicates, it will respawn. | ||
Line 19: | Line 19: | ||
function onPlayerCommand( player, cmd, text ) | function onPlayerCommand( player, cmd, text ) | ||
{ | { | ||
− | if ( cmd == " | + | if ( cmd == "vehidlerespawntime" ) |
{ | { | ||
− | if ( player.Vehicle ) MessagePlayer( "Your vehicles respawn time is: " + player.Vehicle.IdleRespawnTime, player ); | + | if ( player.Vehicle ) MessagePlayer( "Your vehicles idle respawn time is: " + player.Vehicle.IdleRespawnTime, player ); |
} | } | ||
Latest revision as of 11:08, 11 October 2010
This Vehicle class member returns or sets the idle respawn time of the given vehicle as seconds. If the vehicle is unused longer than this time limit indicates, it will respawn.
[edit] Syntax
You can either return or set a new value using this member:
int Vehicle.IdleRespawnTime
Vehicle.IdleRespawnTime = int iTime
[edit] Arguments
- iTime - This is the new idle respawn time for the vehicle
[edit] Example 1. Returning
This command will return the idle respawn time of the vehicle the player is driving.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "vehidlerespawntime" ) { if ( player.Vehicle ) MessagePlayer( "Your vehicles idle respawn time is: " + player.Vehicle.IdleRespawnTime, player ); } return 1; }
[edit] Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.
[edit] Example 2. Setting
This command will set the idle respawn time of the vehicle the player is driving to 5 minutes.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setvehidle" ) { if ( player.Vehicle ) player.Vehicle.IdleRespawnTime = 300; } return 1; }
[edit] Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.
[edit] 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