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

Function

resetVehicleIdleTime

ServerVehiclesIdentical to MTA:SA

Resets the vehicle's idle counter, as if someone had just got out. The countdown to returning an abandoned vehicle (setVehicleIdleRespawnDelay) starts again. Useful e.g. when a player has parked the car in a garage and you want to give them more time.

Syntax

bool resetVehicleIdleTime(vehicle vehicle)

Arguments

vehiclevehicle
The vehicle.

Returns

true on success.

Example

addCommandHandler("przedluz", function(player)
    local vehicle = getPedOccupiedVehicle(player) or getElementData(player, "ostatnieAuto")
    if vehicle and isElement(vehicle) then resetVehicleIdleTime(vehicle) end
end)

See also