- Documentation
- Server events
- onVehicleExplode
Event
onVehicleExplode
A vehicle exploded.
Handler
addEventHandler("onVehicleExplode", root, function(withExplosion) ... end)Parameters
withExplosionbooltruewith an explosion (not silently).
Differences from MTA:SA
- These MTA:SA parameters are not here:
player player
In MTA:SA
function(bool withExplosion, player player)Source
source is the vehicle.
Example
addEventHandler("onVehicleExplode", root, function()
setTimer(respawnVehicle, 10000, 1, source)
end)
See also
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.onVehicleRespawnA vehicle respawned (respawnVehicleor automatically).