SetVehicleDoorOpen
DocsSetVehicleDoorOpen(vehicle, doorIndex, loose, openInstantly)Description
Sets the specified door index open on the passed vehicle. See <code>IS_VEHICLE_DOOR_FULLY_OPEN</code>.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | Vehicle. |
doorIndex | int | Index of the door you want to open (0-7) |
loose | BOOL | Whether the door is "loose" (if true the doors have no "spring" and can be closed easily.) |
openInstantly | BOOL | Whether the doors open instantly (if true this native seems to ignore loose) |
Quick Snippet: Get Vehiclevehicle
vehicleUse this to get the current vehicle handle for this native.
-- Get the vehicle the player is currently in
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
print("Vehicle handle: " .. vehicle)
print("Model: " .. GetEntityModel(vehicle))
else
print("Player is not in a vehicle")
endVehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
local Vehicle = GetVehiclePedIsUsing(PlayerPedId())
for i = 0, 5 do
SetVehicleDoorOpen(Vehicle, i, false, true) -- will open every door from 0-5
end