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

Function

getVehicleDoorState

Server and clientVehiclesIdentical to MTA:SA

Returns the state of one door of a vehicle (0 shut, 1 ajar, 2 shut and damaged, 3 ajar and damaged, 4 missing). Door numbering as in setVehicleDoorState.

Syntax

int getVehicleDoorState(vehicle vehicle, int door)

Arguments

vehiclevehicle
The vehicle.
doorint
Door number 0-5.

Returns

State 0-4.

Example

addCommandHandler("drzwi", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if not vehicle then return end
    for door = 0, 5 do
        outputChatBox("Drzwi " .. door .. ": " .. getVehicleDoorState(vehicle, door), player)
    end
end)

See also