M MY Multiplayer: Wiki
Side
Kind

getVehicleWheelFrictionState

Client

Tells how a vehicle's wheels are gripping the ground.

int|table|false getVehicleWheelFrictionState(vehicle vehicle, int|string|table wheels)

Parameters

NameTypeDescription
vehiclevehicleThe vehicle.
wheelsint|string|tableWhich 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

0 rolling normally, 1 spinning, 2 skidding, 3 locked. 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. A vehicle that is streamed out gives 0.

Example

addEventHandler("onClientRender", root, function()
    local vehicle = getPedOccupiedVehicle(localPlayer)
    if not vehicle then return end
    local states = getVehicleWheelFrictionState(vehicle, "rear_wheels")
    if states and (states.wheel_lr == 2 or states.wheel_rr == 2) then
        dxDrawText("DRIFT", 40, 300)
    end
end)
Coming from MTABesides the wheel number, it takes wheel names, groups and tables.

See also