# getPedOccupiedVehicleSeat (Shared)

> Gets the seat a ped or player takes in its vehicle.

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

## Syntax

```lua
int|false getPedOccupiedVehicleSeat(ped ped)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |

## Returns

The seat (`0` is the driver, `1` and up the passengers), or `false` if the ped is not in a vehicle or the element is not a ped.

## Example

```lua
addCommandHandler("seat", function(player)
    if getPedOccupiedVehicleSeat(player) == 0 then
        outputDebugString(getPlayerName(player) .. " is driving")
    end
end)
```

## See also

- [getPedOccupiedVehicle (Shared)](https://wiki.mymp.gg/en/getPedOccupiedVehicle.md): Gets the vehicle a ped or player is in.
- [getVehicleOccupant (Shared)](https://wiki.mymp.gg/en/getVehicleOccupant.md): Returns the ped or player sitting in a seat of a vehicle.
- [warpPedIntoVehicle (Shared)](https://wiki.mymp.gg/en/warpPedIntoVehicle.md): Puts a ped or player straight into a vehicle seat, with no animation.
