ToggleVehicleRespawn: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (→See Also) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | |||
This function toggles whether or not the vehicle will be respawned after blown or idle. | This function toggles whether or not the vehicle will be respawned after blown or idle. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool toggleVehicleRespawn ( vehicle theVehicle, bool Respawn )</syntaxhighlight> | <syntaxhighlight lang="lua">bool toggleVehicleRespawn ( vehicle theVehicle, bool Respawn )</syntaxhighlight> | ||
{{OOP||[[vehicle]]:toggleRespawn|respawnable|isVehicleRespawnable}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle''': The [[vehicle]] you wish to toggle the respawning of. | *'''theVehicle''': The [[vehicle]] you wish to toggle the respawning of. | ||
Line 10: | Line 11: | ||
==Returns== | ==Returns== | ||
Returns 'true' if the vehicle was found and edited. | Returns ''true'' if the vehicle was found and edited. | ||
==Example== | ==Example== | ||
This example defines a console command that will disable respawning for the vehicle that the player is currently in. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function doNotRespawn ( thePlayer ) | |||
function | local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) | ||
if ( theVehicle ) then | |||
toggleVehicleRespawn ( theVehicle, false ) -- tell the server not to respawn this vehicle | |||
if ( | |||
end | end | ||
end | end | ||
addCommandHandler("donotrespawn", doNotRespawn) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle_functions|server}} |
Latest revision as of 23:05, 6 September 2024
This function toggles whether or not the vehicle will be respawned after blown or idle.
Syntax
bool toggleVehicleRespawn ( vehicle theVehicle, bool Respawn )
OOP Syntax Help! I don't understand this!
- Method: vehicle:toggleRespawn(...)
- Variable: .respawnable
- Counterpart: isVehicleRespawnable
Required Arguments
- theVehicle: The vehicle you wish to toggle the respawning of.
- Respawn: A boolean determining if the vehicle will respawn or not.
Returns
Returns true if the vehicle was found and edited.
Example
This example defines a console command that will disable respawning for the vehicle that the player is currently in.
function doNotRespawn ( thePlayer ) local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( theVehicle ) then toggleVehicleRespawn ( theVehicle, false ) -- tell the server not to respawn this vehicle end end addCommandHandler("donotrespawn", doNotRespawn)
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