getVehicleWheelState
Shared
Returns the state of one or more wheels of a vehicle.
int|table|false getVehicleWheelState(vehicle vehicle, int|string|table wheel)
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | vehicle | The vehicle. |
| wheel | int|string|table | Which wheel: its number (0 front left, 1 rear left, 2 front right, 3 rear right), its frame name (wheel_lf, wheel_lr, wheel_rf, wheel_rr), a group (all, front_wheels, rear_wheels, left_wheels, right_wheels), -1 for all of them or a table of several. |
Returns
The state (0 inflated, 1 flat, 2 fallen off, 3 drawn but without collision). When several wheels were asked for (a group, -1 or a table), a table of frame name → value. false if the vehicle lacks one of the wheels named.
Example
addCommandHandler("pneus", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle and getVehicleWheelState(vehicle, "wheel_lf") == 1 then
outputDebugString("front left tyre is flat")
end
end)