# getVehicleHandling (Shared)

> Reads a vehicle's handling: its mass, engine, traction, suspension and the rest of what decides how it drives.

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

## Syntax

```lua
table|any getVehicleHandling(vehicle vehicle [, string property = nil])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `vehicle` | The vehicle. |
| `property` | `string` | A single property. An unknown name raises an error. *(default: `nil`)* |

## Returns

Without `property`, a table with every property. With it, that property's value. `false` if the vehicle has no handling.

### Handling properties

| Type     | Properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Numbers  | `mass`, `turnMass`, `inertiaShape`, `dragCoeff`, `tractionMultiplier`, `engineAcceleration`, `engineInertia`, `maxVelocity`, `clutchUpShift`, `clutchDownShift`, `brakeDeceleration`, `brakeBias`, `steeringLock`, `tractionLoss`, `tractionBias`, `tractionLoadSensitivity`, `tractionSlipPeak`, `tractionSlipSlide`, `suspensionForceLevel`, `suspensionDamping`, `suspensionHighSpeedDamping`, `suspensionUpperLimit`, `suspensionLowerLimit`, `suspensionFrontRearBias`, `suspensionAntiDiveMultiplier`, `suspensionAntiRollFront`, `suspensionAntiRollRear`, `suspensionReboundRatio`, `collisionDamageMultiplier`, `seatOffsetDistance` |
| Integers | `percentSubmerged`, `numberOfGears`, `monetary`, `handlingFlags`, `modelFlags`, `animGroup`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Boolean  | `ABS`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Strings  | `driveType` (`fwd`, `rwd`, `awd`), `engineType` (`petrol`, `diesel`, `electric`), `headLight` and `tailLight` (`long`, `small`, `big`, `tall`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Table    | `centerOfMass` (`{x, y, z}`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Example

```lua
addCommandHandler("handling", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        local handling = getVehicleHandling(vehicle)
        outputDebugString(("mass %.0f, top speed %.0f"):format(handling.mass, handling.maxVelocity))
    end
end)
```

### Coming from MTA

In MTA, `getVehicleHandling` only returns the whole table. Here you can ask for one property.

### Note

Asked for on its own, `ABS` comes back as a number (1 or 0); in the table, it is a boolean.

## See also

- [setVehicleHandling (Server)](https://wiki.mymp.gg/en/setVehicleHandling-server.md): Changes a vehicle's handling for every player.
- [setVehicleHandling (Client)](https://wiki.mymp.gg/en/setVehicleHandling-client.md): Changes a vehicle's handling on this client only.
- [getOriginalHandling (Server)](https://wiki.mymp.gg/en/getOriginalHandling-server.md): Reads a vehicle model's original handling, as the content packs declare it, without any script's changes.
- [getModelHandling (Server)](https://wiki.mymp.gg/en/getModelHandling.md): Reads a vehicle model's handling, which new vehicles of that model start with.
