getVehicleLandingGearDown | Multi Theft Auto: Wiki Skip to content

getVehicleLandingGearDown

Client-side
Server-side
Shared

Pair: setVehicleLandingGearDown

Manual Review Required

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


This function is used to check whether a vehicle's landing gear is down or not. Only planes can be used with this function.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:getLandingGearDown(...)
  • Variable: .landingGearDown

Syntax

bool getVehicleLandingGearDown ( vehicle theVehicle )
Required Arguments
  • theVehicle: the vehicle of which you wish to check the landing gear state.

Returns

  • bool: value

Returns true if landing gear is down, false if the landing gear is up. Returns nil if the vehicle has no landing gear, or is invalid.

Code Examples

shared

This function tells you to pull up the landing gear if you're in a Hydra with its landing gear down.

function checkGear( thePlayer )
local theVehicle = getPedOccupiedVehicle( thePlayer ) --Get the players vehicle
if ( getElementModel(theVehicle) == 520 and getVehicleLandingGearDown( theVehicle ) == false ) then --if the vehicle is a hydra, and the landing gear is up
outputChatBox( "Pull up!", thePlayer ) --tell the player to pull up.
end
end

See Also

Vehicle Functions