-- 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