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

Function

setVehicleIdleRespawnDelay

ServerVehiclesIdentical to MTA:SA

Sets after how many milliseconds an abandoned vehicle returns to its respawn point by itself. "Abandoned" means nobody is inside and it stands more than 0.5 m from the respawn point. The counter resets when someone gets in. The default is 60000 ms; 0 turns returning of abandoned vehicles off. The countdown runs for vehicles whose respawning was configured with any function from this group (e.g. this one) or which have been a wreck; a freshly created, unconfigured vehicle does not return by itself.

Syntax

bool setVehicleIdleRespawnDelay(vehicle vehicle, int ms)

Arguments

vehiclevehicle
The vehicle.
msint
Time in milliseconds, 0 = off.

Returns

true on success.

Example

for _, vehicle in ipairs(getElementsByType("vehicle", resourceRoot)) do
    setVehicleIdleRespawnDelay(vehicle, 10 * 60000)
end

See also