Scripting/Squirrel/Functions/Vehicles/Respawn
From VC-MP Wiki
This function respawns the vehicle. Note that if the vehicle has players inside while respawning it that may cause a client crash for everyone else but the driver.
Syntax
bool vehicle.Respawn()
Arguments
- none
Example
This command will respawn a car by using '/c respawn <car id>'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "respawn" ) { local vehicle = FindVehicle( text.tointeger() ); vehicle.Respawn(); } }
Notes
The call onPlayerCommand and function FindVehicle were also used in this example. More info about this in the corresponding page.
Related Functions
- CreateVehicle
- FindVehicle
- GetVehicleCount
- GetVehicleModelFromName
- GetVehicleNameFromModel
- Vehicle.Alarm
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.Fix
- Vehicle.Health
- Vehicle.ID
- Vehicle.IsLocked
- Vehicle.KillEngine
- Vehicle.Lights
- Vehicle.Model
- Vehicle.Pos
- Vehicle.Respawn
- Vehicle.RespawnAs
- Vehicle.RespawnAt
- Vehicle.SetFlatTyres
- Vehicle.SpawnPos
- Vehicle.SpawnAngle
- Vehicle.Velocity
- Vehicle.Remove
