getVehicleDoorState | Multi Theft Auto: Wiki Skip to content

getVehicleDoorState

Client-side
Server-side
Shared

Pair: setVehicleDoorState

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function returns the current state of the specifed door on the vehicle.

Syntax

getVehicleDoorState ( )

Code Examples

server

This example implements a doesVehicleHaveDoorOpen() function, that returns true if any of the doors on a vehicle are open.

function doesVehicleHaveDoorOpen(vehicle)
local isDoorAjar = false
for i=0,5 do
local doorState = getVehicleDoorState(vehicle, i)
if doorState == 1 or doorState == 3 or doorState == 4 then
isDoorAjar = true
end
end
return isDoorAjar
end

See Also

Vehicle Functions