# onVehicleEnter (Server)

> Fired on the server when a ped has finished getting into a vehicle.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Event
- **Side**: Server
- **Category**: Vehicles
- **URL**: https://wiki.mymp.gg/en/onVehicleEnter

## Syntax

```lua
addEventHandler("onVehicleEnter", root, function(ped ped, int seat, ped|false jacked) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player that got in. |
| `seat` | `int` | The seat: 0 is the driver's, 1 onwards the passengers'. |
| `jacked` | `ped\|false` | The ped that was in the seat and was taken out, or `false`. |

## Source

The vehicle.

It also fires when `warpPedIntoVehicle` puts the ped in the vehicle. When the driver gets in, the engine starts.

## Example

```lua
addEventHandler("onVehicleEnter", root, function(ped, seat)
    if seat == 0 and getElementType(ped) == "player" then
        setElementData(source, "dono", getPlayerName(ped))
    end
end)
```

## See also

- [onVehicleStartEnter (Server)](https://wiki.mymp.gg/en/onVehicleStartEnter.md): Fired on the server when a ped starts getting into a vehicle. Cancelling the event stops it.
- [onVehicleExit (Server)](https://wiki.mymp.gg/en/onVehicleExit.md): Fired on the server when a ped leaves a vehicle.
- [onPlayerVehicleEnter (Server)](https://wiki.mymp.gg/en/onPlayerVehicleEnter.md): Fired on the server when a player has finished getting into a vehicle.
- [onClientVehicleEnter (Client)](https://wiki.mymp.gg/en/onClientVehicleEnter.md): Fired on the client when a ped has finished getting into a vehicle.
