resetVehicleExplosionTime | Multi Theft Auto: Wiki Skip to content

resetVehicleExplosionTime

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Resets the vehicle explosion time. This is the point in time at which the vehicle last exploded: at this time plus the vehicle's respawn delay, the vehicle is respawned. You can use this function to prevent the vehicle from respawning.

Syntax

resetVehicleExplosionTime ( )

Code Examples

server

This example resets every vehicle's explosion time when the resource is stopped.

function resetVehiclesExplosionTime ()
local vehicles = getElementsByType ( "vehicle" ) -- Return all the vehicles in a table
for k, vehicle in ipairs ( vehicles ) do -- For every vehicle do the following...
resetVehicleExplosionTime ( vehicle ) -- Reset the vehicle's explosion time
end
end
-- When this resource is stopped, trigger the resetVehiclesExplosionTime function (above).
addEventHandler ( "onResourceStop", resourceRoot, resetVehiclesExplosionTime )

See Also

Vehicle Functions