GetVehicleRespawnDelay

From Multi Theft Auto: Wiki
Revision as of 09:41, 9 June 2024 by Tracer (talk | contribs) (Created page with "__NOTOC__ {{Server function}} This function gets the time delay (in milliseconds) the vehicle will remain wrecked before respawning. ==Syntax== <syntaxhighlight lang="lua"> int getVehicleRespawnDelay ( vehicle theVehicle ) </syntaxhighlight> {{OOP||vehicle:getRespawnDelay|respawnDelay|setVehicleRespawnDelay}} ===Required Arguments=== *'''theVehicle''': The vehicle you wish to get the respawn delay of. ==Returns== Returns the delay in milliseconds. ==Example=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the time delay (in milliseconds) the vehicle will remain wrecked before respawning.

Syntax

int getVehicleRespawnDelay ( vehicle theVehicle )


OOP Syntax Help! I don't understand this!

Method: vehicle:getRespawnDelay(...)
Variable: .respawnDelay
Counterpart: setVehicleRespawnDelay


Required Arguments

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

Returns

Returns the delay in milliseconds.

Example

Click to collapse [-]
Server

This example gets the 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 = getVehicleRespawnDelay(veh)
    outputChatBox('Vehicle delay: '..delay..'ms', player)
end)

See Also

Shared