ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. isVehicleBlown

Function

isVehicleBlown

Server and clientVehiclesIdentical to MTA:SA

Checks whether a vehicle is a wreck, i.e. it was destroyed (blowVehicle or an explosion in the game) and has not been repaired or respawned yet. A wreck cannot be driven.

Syntax

bool isVehicleBlown(vehicle vehicle)

Arguments

vehiclevehicle
The vehicle to check.

Returns

true for a wreck, otherwise false.

Example

addCommandHandler("wraki", function(player)
    local count = 0
    for _, vehicle in ipairs(getElementsByType("vehicle")) do
        if isVehicleBlown(vehicle) then count = count + 1 end
    end
    outputChatBox("Wrakow na mapie: " .. count, player)
end)

See also