- Documentation
- Server functions
- resetVehicleExplosionTime
Function
resetVehicleExplosionTime
Restarts the countdown to a wreck respawn: the wreck respawns after the full time from setVehicleRespawnDelay, counted from now. When the vehicle is not a wreck waiting to respawn, the function changes nothing.
Syntax
bool resetVehicleExplosionTime(vehicle vehicle)Arguments
vehiclevehicle- The vehicle.
Returns
true on success.
Example
addEventHandler("onVehicleExplode", root, function()
if getElementData(source, "dowod") then
setVehicleRespawnDelay(source, 120000)
resetVehicleExplosionTime(source)
end
end)
See also
setVehicleRespawnDelaySets how many milliseconds after destruction a vehicle's wreck respawns at its respawn point. The default is 10000 ms (10 s). Only works with respawning enabled (toggleVehicleRespawn). The new time applies to later explosions; for a wreck already waiting useresetVehicleExplosionTime.blowVehicleDestroys a vehicle: health drops to 0, the engine stops, the vehicle becomes a wreck (isVehicleBlown=true) and theonVehicleExplodeevent fires. By default every player also sees an explosion. If respawning is enabled for the vehicle (toggleVehicleRespawn, off by default), the wreck returns to its spawn point after the time set withsetVehicleRespawnDelay(10 s by default); without respawning the wreck disappears after the time fromsetVehicleWreckDelay(20 s by default). Blowing up an already destroyed vehicle does nothing.