IsVehicleOnGround: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
This example tells you when you've jumped out of a vehicle. | This example tells you when you've jumped out of a vehicle. | ||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function checkVState ( vehicle, seat, jacked ) | function checkVState ( vehicle, seat, jacked ) | ||
Line 28: | Line 29: | ||
end | end | ||
addEventHandler ( "onPlayerVehicleExit", getRootElement(), checkVState ) | addEventHandler ( "onPlayerVehicleExit", getRootElement(), checkVState ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{Vehicle functions}} | {{Vehicle functions}} | ||
[[Category:Needs_Example]] | [[Category:Needs_Example]] |
Revision as of 16:02, 5 July 2009
Checks to see if a vehicle has contact with the ground.
Syntax
bool isVehicleOnGround ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you wish to check.
Returns
Returns true if vehicle is on the ground, false if it is not.
Example
This example tells you when you've jumped out of a vehicle.
Click to collapse [-]
Serverfunction checkVState ( vehicle, seat, jacked ) vehName = getVehicleName ( vehicle ) if isVehicleOnGround ( vehicle ) == false then outputChatBox ( "You jumped out of a "..vehName.."!", source, 255, 0, 0 ) end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), checkVState )
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