GetVehicleIdleRespawnDelay

From Multi Theft Auto: Wiki
Revision as of 09:44, 9 June 2024 by Tracer (talk | contribs) (Created page with "__NOTOC__ {{Server function}} {{Added feature/item|1.6.1|1.6.0|22505|This function gets the time delay (in milliseconds) the vehicle will remain at its position while empty.}} ==Syntax== <syntaxhighlight lang="lua"> int getVehicleIdleRespawnDelay ( vehicle theVehicle ) </syntaxhighlight> {{OOP||vehicle:getIdleRespawnDelay|idleRespawnDelay|setVehicleIdleRespawnDelay}} ===Required Arguments=== *'''theVehicle''': The vehicle you wish to get the idle delay of. ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BETA: NEW FEATURE (BUILD: 1.6.0 r22505)
This function gets the time delay (in milliseconds) the vehicle will remain at its position while empty.

Syntax

int getVehicleIdleRespawnDelay ( vehicle theVehicle )


OOP Syntax Help! I don't understand this!

Method: vehicle:getIdleRespawnDelay(...)
Variable: .idleRespawnDelay
Counterpart: setVehicleIdleRespawnDelay


Required Arguments

  • theVehicle: The vehicle you wish to get the idle delay of.

Returns

Returns the delay in milliseconds.

Example

Click to collapse [-]
Server

This example gets the idle delay of a current occupying vehicle.

addCommandHandler("getVehicleDelay", function(player)
    local veh = getPedOccupiedVehicle(player)
    if not veh then
        outputChatBox('You must be in a vehicle!', player)
        return
    end
    local delay = getVehicleIdleRespawnDelay(veh)
    outputChatBox('Idle vehicle delay: '..delay..'ms', player)
end)

See Also