# getVehicleController (Shared)

> Returns who is driving a vehicle, that is the occupant of seat 0.

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

## Syntax

```lua
ped|false getVehicleController(vehicle vehicle)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `vehicle` | The vehicle. |

## Returns

The ped or player in the driver's seat, or `false` if nobody is there or the element is not a vehicle.

## Example

```lua
addEventHandler("onVehicleExit", root, function()
    if not getVehicleController(source) then
        setVehicleEngineState(source, false)
    end
end)
```

## See also

- [getVehicleOccupant (Shared)](https://wiki.mymp.gg/en/getVehicleOccupant.md): Returns the ped or player sitting in a seat of a vehicle.
- [getVehicleOccupants (Shared)](https://wiki.mymp.gg/en/getVehicleOccupants.md): Returns every ped and player inside a vehicle.
- [getPedOccupiedVehicleSeat (Shared)](https://wiki.mymp.gg/en/getPedOccupiedVehicleSeat.md): Gets the seat a ped or player takes in its vehicle.
