ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleWreckDelay

Function

setVehicleWreckDelay

ServerVehiclesTrilogy Hub only

Sets how many milliseconds after the explosion a vehicle wreck disappears from the map (the element is destroyed, with onElementDestroy called; players inside fall out). The default is 20000 ms (20 s); 0 = the wreck stays forever. Passing root changes the default for all vehicles without their own setting. Does not apply to vehicles with respawning enabled (toggleVehicleRespawn) — those come back repaired at their respawn point. fixVehicle before the time runs out stops the removal. A change for a wreck already waiting restarts the countdown.

Syntax

bool setVehicleWreckDelay(vehicle vehicle, int ms)

Arguments

vehiclevehicle
A vehicle or root.
msint
Time in milliseconds, 0 = the wreck stays.

Returns

true on success.

Example

-- wraki znikaja po minucie, a auta frakcji zostaja
setVehicleWreckDelay(root, 60000)
local radiowoz = createVehicle(596, 1535, -1675, 13.4)
setVehicleWreckDelay(radiowoz, 0)

See also