SetVehicleLandingGearDown: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:
This page does not have an example
This page does not have an example
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here.
function checkGear( thePlayer )
    local theVehicle = getPedOccupiedVehicle( thePlayer )    --Get the players vehicle
    if ( getElementModel(theVehicle) == 520 and getVehicleLandingGearDown( theVehicle ) == true) then --if the vehicle is a hydra, and the landing gear is down
      setVehicleLandingGearDown(theVehicle,false) --Set the landing gear up
      outputChatBox( "Pull up!", thePlayer )    --and tell the player to pull up.
    end
end
</syntaxhighlight>
</syntaxhighlight>



Revision as of 17:31, 7 April 2012

This function is used to set the landing gear state of certain vehicles.

Syntax

bool setVehicleLandingGearDown ( vehicle theVehicle, bool gearState )

Required Arguments

  • theVehicle: The vehicle of which you wish to set the landing gear state.
  • gearState: A bool representing the state of the landing gear. true represents a collapsed landing gear, while false represents a disabled landing gear.

Returns

Returns true if the landing gear was set successfully, false otherwise.

Example

This page does not have an example

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

See Also