GetVehicleRespawnDelay: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Added `Added feature`)
 
Line 34: Line 34:


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle_functions|server}}

Latest revision as of 23:03, 6 September 2024

BETA: NEW FEATURE (BUILD: 1.6.0 r22505)
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