GetVehicleLandingGearDown: Difference between revisions
Jump to navigation
Jump to search
Black Dragon (talk | contribs) mNo edit summary |
m (→Syntax) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Server client function}} | ||
This function is used to check whether a | 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== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool getVehicleLandingGearDown ( vehicle | bool getVehicleLandingGearDown ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:getLandingGearDown|landingGearDown|setVehicleLandingGearDown}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theVehicle:''' the [[vehicle]] of which you wish to check the landing gear state. | ||
===Returns=== | ===Returns=== | ||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This function tells you to pull up if you're | This function tells you to pull up the landing gear if you're in a Hydra with its landing gear down. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function checkGear( | function checkGear( thePlayer ) | ||
local theVehicle = getPedOccupiedVehicle( thePlayer ) --Get the players vehicle | |||
if ( ( | if ( getElementModel(theVehicle) == 520 and getVehicleLandingGearDown( theVehicle ) == false ) then --if the vehicle is a hydra, and the landing gear is up | ||
outputChatBox( "Pull up!", | outputChatBox( "Pull up!", thePlayer ) --tell the player to pull up. | ||
end | end | ||
end | end | ||
Line 28: | Line 28: | ||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} | ||
[[ | [[ru:getVehicleLandingGearDown ]] |
Latest revision as of 06:24, 17 June 2023
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 )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getLandingGearDown(...)
- Variable: .landingGearDown
- Counterpart: setVehicleLandingGearDown
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 = 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
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates