setVehicleWheelStates
Shared
Changes the state of a vehicle's four wheels at once.
bool setVehicleWheelStates(element vehicle, int frontLeft [, int rearLeft = -1, int frontRight = -1, int rearRight = -1])
Parameters
| Name | Type | Description |
|---|---|---|
| vehicle | element | The vehicle, or a parent element whose vehicles all change. |
| frontLeft | int | The front left wheel's state: 0 inflated, 1 flat, 2 fallen off, 3 drawn but without collision. -1 keeps the current one. |
| rearLeft | int | The rear left wheel's state, or -1 to keep it.default -1 |
| frontRight | int | The front right wheel's state, or -1 to keep it.default -1 |
| rearRight | int | The rear right wheel's state, or -1 to keep it.default -1 |
Returns
true if any wheel changed. false if one of the states is out of range (nothing changes) or no wheel changed.
Given a parent element such as root, it applies to every vehicle below it, but the value returned is the element's own: false when it is not a vehicle.
Example
addCommandHandler("pneusnovos", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then
setVehicleWheelStates(vehicle, 0, 0, 0, 0)
end
end)