M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
vehicleelementThe vehicle, or a parent element whose vehicles all change.
frontLeftintThe front left wheel's state: 0 inflated, 1 flat, 2 fallen off, 3 drawn but without collision. -1 keeps the current one.
rearLeftintThe rear left wheel's state, or -1 to keep it.default -1
frontRightintThe front right wheel's state, or -1 to keep it.default -1
rearRightintThe 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)

See also