SetOpenRearDoorsOnExplosion
DocsSetOpenRearDoorsOnExplosion(vehicle, toggle)Description
Enables or disables the opening of a vehicle's rear doors in the event of a sticky bomb explosion. This native is effective for armored vehicles, such as the Stockade (Brinks vehicle), allowing the rear doors to be opened through controlled explosions, which might otherwise remain locked due to the vehicle nature.
Parameters
| Name | Type | Description |
|---|---|---|
vehicle | Vehicle | The vehicle to apply this setting to. |
toggle | BOOL | A boolean value where `true` allows the rear doors to open upon explosion, and `false` prevents them from opening. |
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
-- This example disables the rear doors of the vehicle from opening upon explosion.
-- Retrieve the LocalPlayer.
local playerPed = PlayerPedId()
-- Retrieve the vehicle the player is currently in.
local vehicle = GetVehiclePedIsIn(playerPed, false)
-- Check if the vehicle exists in the game world.
if not DoesEntityExist(vehicle) then
-- If the vehicle does not exist, end the execution of the code here.
return
end
-- Retrieve the model of the vehicle
local modelVehicle = GetEntityModel(vehicle)
-- Retrieve the hash of the Stockade.
local hashStockade = GetHashKey("stockade")
-- Check if the vehicle is a Stockade.
if (modelVehicle == hashStockade) then
-- Disable the rear doors from opening upon explosion.
SetOpenRearDoorsOnExplosion(vehicle, true)
end