RespawnVehicle: Difference between revisions
Jump to navigation
Jump to search
(RespawnVehicle moved to SpawnVehicle) |
m (→See Also) |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{Server function}} | |||
__NOTOC__ | |||
This function respawns a vehicle according to its set respawn position, set by [[setVehicleRespawnPosition]] or the position and rotation it was created on. To spawn a vehicle to a specific location just once, [[spawnVehicle]] can be used. | |||
==Syntax== | |||
<syntaxhighlight lang="lua"> | |||
bool respawnVehicle ( vehicle theVehicle ) | |||
</syntaxhighlight> | |||
{{OOP||[[vehicle]]:respawn}} | |||
===Required Arguments=== | |||
*'''theVehicle:''' The vehicle you wish to respawn | |||
===Returns=== | |||
Returns ''true'' if the vehicle respawned successfully, ''false'' if the passed argument does not exist or is not a vehicle. | |||
==Example== | |||
<!-- Explain what the example is in a single sentance --> | |||
This example makes an exploded vehicle re-spawn after 5 seconds. | |||
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | |||
<syntaxhighlight lang="lua"> | |||
function respawnExplodedVehicle() | |||
setTimer(respawnVehicle, 5000, 1, source) | |||
end | |||
addEventHandler("onVehicleExplode", root, respawnExplodedVehicle) | |||
</syntaxhighlight> | |||
==See Also== | |||
{{Vehicle_functions|server}} |
Latest revision as of 23:04, 6 September 2024
This function respawns a vehicle according to its set respawn position, set by setVehicleRespawnPosition or the position and rotation it was created on. To spawn a vehicle to a specific location just once, spawnVehicle can be used.
Syntax
bool respawnVehicle ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:respawn(...)
Required Arguments
- theVehicle: The vehicle you wish to respawn
Returns
Returns true if the vehicle respawned successfully, false if the passed argument does not exist or is not a vehicle.
Example
This example makes an exploded vehicle re-spawn after 5 seconds.
function respawnExplodedVehicle() setTimer(respawnVehicle, 5000, 1, source) end addEventHandler("onVehicleExplode", root, respawnExplodedVehicle)
See Also
- addVehicleSirens
- getModelHandling
- getVehicleIdleRespawnDelay
- getVehicleRespawnDelay
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehiclesOfType
- isVehicleRespawnable
- removeVehicleSirens
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setVehicleIdleRespawnDelay
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- spawnVehicle
- toggleVehicleRespawn
- Shared
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates