# removePedFromVehicle (Shared)

> Takes a ped or player out of its vehicle at once, with no animation.

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

## Syntax

```lua
bool removePedFromVehicle(ped ped)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. It also applies to the element's children. |

## Returns

`true` if the ped was taken out. `false` if it is not in a vehicle or getting into one.

If the ped was getting in, the entry is cancelled. The exit events fire; on the server, with `forcedByScript` set to `true`.

## Example

```lua
addEventHandler("onVehicleEnter", root, function(ped, seat)
    if seat == 0 and getElementType(ped) == "ped" then
        removePedFromVehicle(ped)
    end
end)
```

### Note

On the client it only works with peds that client created; server elements raise an error.

## See also

- [warpPedIntoVehicle (Shared)](https://wiki.mymp.gg/en/warpPedIntoVehicle.md): Puts a ped or player straight into a vehicle seat, with no animation.
- [setPedExitVehicle (Client)](https://wiki.mymp.gg/en/setPedExitVehicle.md): Makes a ped get out of its vehicle through the door, with the exit animation.
- [isPedInVehicle (Shared)](https://wiki.mymp.gg/en/isPedInVehicle.md): Tells whether a ped or player is in a vehicle.
- [onVehicleExit (Server)](https://wiki.mymp.gg/en/onVehicleExit.md): Fired on the server when a ped leaves a vehicle.
