isVehicleWheelOnGround
Client
Tells whether a vehicle's wheels are touching something.
bool|table isVehicleWheelOnGround(vehicle vehicle, int|string|table wheels)
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle. |
| wheels | int|string|table | Which wheels: a number (0 front left, 1 rear left, 2 front right, 3 rear right, -1 all), a name (wheel_lf, wheel_lr, wheel_rf, wheel_rr), a group (all, front_wheels, rear_wheels, left_wheels, right_wheels) or a table of these. |
Returns
true for each wheel touching the ground or another object. A single value when wheels is one number or name outside a table; otherwise a table with each wheel's value, keyed by wheel name. false if the vehicle lacks any of the wheels asked for.
Example
local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
local front = isVehicleWheelOnGround(vehicle, "front_wheels")
if front and not front.wheel_lf and not front.wheel_rf then
outputDebugString("Empinando")
end
endComing from MTABesides the wheel number, it takes wheel names, groups and tables.
NoteWhile the vehicle is streamed out, every wheel gives
true.