GetVehicleLandingGearDown: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool getVehicleLandingGearDown ( vehicle thevehicle )
bool getVehicleLandingGearDown ( vehicle theVehicle )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''thevehicle:''' The vehicle of which you wish to check the landing gear state.
*'''theVehicle:''' The vehicle of which you wish to check the landing gear state.


===Returns===
===Returns===
Line 28: Line 28:
==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}
[[Category:Incomplete]]

Revision as of 20:18, 28 March 2008

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

Syntax

bool getVehicleLandingGearDown ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle of which you wish to check the landing gear state.

Returns

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.

Example

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 = getPlayerOccupiedVehicle( thePlayer )    --Get the players vehicle
    if ( getVehicleID(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