# setVehicleWheelStates (Shared)

> Changes the state of a vehicle's four wheels at once.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Vehicles
- **URL**: https://wiki.mymp.gg/en/setVehicleWheelStates

## Syntax

```lua
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

```lua
addCommandHandler("pneusnovos", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleWheelStates(vehicle, 0, 0, 0, 0)
    end
end)
```

## See also

- [getVehicleWheelStates (Shared)](https://wiki.mymp.gg/en/getVehicleWheelStates.md): Returns the state of a vehicle's four wheels.
- [setVehicleWheelState (Shared)](https://wiki.mymp.gg/en/setVehicleWheelState.md): Changes the state of one or more wheels of a vehicle: inflated, flat, fallen off or without collision.
