| Property | Value |
|---|---|
| Native Name | ARE_PLANE_CONTROL_PANELS_INTACT |
| Hash | 0xF78F94D60248C737 |
| Return Type | BOOL |
| Parameters | vehicle (Vehicle), checkForZeroHealth (BOOL) |
Description: Queries whether the control panels of a plane are intact. This native is used to determine the operational status of a plane's cockpit controls, which can affect the plane's flyability.
Parameters
vehicle(Vehicle) — The vehicle to check. This should be a plane.checkForZeroHealth(BOOL) — If set totrue, the native also checks if the plane's health is zero, indicating it is completely destroyed. Iffalse, only the state of the control panels is considered.
Examples
-- Retrieve the player ped
local playerPed = PlayerPedId()
-- Retrieve the plane the player is currently in.
local plane = GetVehiclePedIsIn(playerPed, false)
-- If the player is not in a plane, return
if (plane == 0) or (not IsThisModelAPlane(GetEntityModel(plane))) then return end
-- Check if the plane's control panels are intact
local controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true)
if (controlPanelsIntact) then
print("The plane's control panels are intact")
else
print("The plane's control panels are damaged or the plane is destroyed")
end
// Retrieve the player ped
const playerPed = PlayerPedId();
// Retrieve the plane the player is currently in.
const plane = GetVehiclePedIsIn(playerPed, false);
// If the player is not in a plane, return
if (plane === 0 || !IsThisModelAPlane(GetEntityModel(plane))) return;
// Check if the plane's control panels are intact
const controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true);
if (controlPanelsIntact) {
console.log("The plane's control panels are intact");
} else {
console.log("The plane's control panels are damaged or the plane is destroyed");
}
using static CitizenFX.Core.Native.API;
// Retrieve the player ped
int playerPed = PlayerPedId();
// Retrieve the plane the player is currently flying
int plane = GetVehiclePedIsIn(playerPed, false);
// If the player is not flying a plane, return
if (plane == 0 || !IsThisModelAPlane(GetEntityModel(plane))) return;
// Check if the plane's control panels are intact
bool controlPanelsIntact = ArePlaneControlPanelsIntact(plane, true);
if (controlPanelsIntact) {
Debug.WriteLine("The plane's control panels are intact");
} else {
Debug.WriteLine("The plane's control panels are damaged or the plane is destroyed");
}