isVehicleWheelOnGround | Multi Theft Auto: Wiki Skip to content

isVehicleWheelOnGround

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function returns a boolean whether the vehicle's wheel is on ground (true) or in air (false).

Note

In vehicles with 3 wheels, the wheels are combined 2 in 1, in motorbikes only the left - "front_left" and "rear_left"

Syntax

isVehicleWheelOnGround ( )

Code Examples

client

This example displays four colored rectangles on the screen. If the wheel is colliding, the rectangle will be green, otherwise it will be red.

local Green = tocolor(0, 255, 0, 255)
local Red = tocolor(255, 0, 0, 255)
addEventHandler( "onClientRender", root,
function( )
local theVehicle = getPedOccupiedVehicle( localPlayer )
if isElement( theVehicle ) then
dxDrawRectangle( 100, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 0 ) and Green or Red )
dxDrawRectangle( 100, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 1 ) and Green or Red )
dxDrawRectangle( 140, 100, 20, 20, isVehicleWheelOnGround ( theVehicle, 2 ) and Green or Red )
dxDrawRectangle( 140, 140, 20, 20, isVehicleWheelOnGround ( theVehicle, 3 ) and Green or Red )
end
end
)

See Also

Vehicle Functions