isVehicleOnGround | Multi Theft Auto: Wiki Skip to content

isVehicleOnGround

Client-side
Server-side
Shared

Manual Review Required

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


Checks to see if a vehicle has contact with the ground.

Note

This function has a few issues, see below. Consider using the clientside function isVehicleWheelOnGround instead.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:isOnGround(...)
  • Variable: .onGround

Syntax

bool isVehicleOnGround ( vehicle theVehicle )
Required Arguments
  • theVehicle: The vehicle you wish to check.

Returns

  • bool: value

Returns true if vehicle is on the ground, false if it is not.

Code Examples

shared
function 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 )

Issues

ID Description
471 isVehicleOnGround sometimes returns false incorrectly
2093 isVehicleOnGround does not work after setVehicleHandling

See Also

Vehicle Functions