# CFX::TASK_LEAVE_VEHICLE

- **Hash:** `0x7B1141C6`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `TaskLeaveVehicle`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/TASK_LEAVE_VEHICLE

## Signature

```c
void TASK_LEAVE_VEHICLE(Ped ped, Vehicle vehicle, int flags);
```

## Parameters

- `ped` (`Ped`)
- `vehicle` (`Vehicle`)
- `flags` (`int`)

## Returns

`void`

## Description

*Source: Cfx.re native reference*

```
Flags from decompiled scripts:
0 = normal exit and closes door.
1 = normal exit and closes door.
16 = teleports outside, door kept closed.  (This flag does not seem to work for the front seats in buses, NPCs continue to exit normally)
64 = normal exit and closes door, maybe a bit slower animation than 0.
256 = normal exit but does not close the door.
4160 = ped is throwing himself out, even when the vehicle is still.
262144 = ped moves to passenger seat first, then exits normally
Others to be tried out: 320, 512, 131072.
```

**This is the server-side RPC native equivalent of the client native [TASK_LEAVE_VEHICLE](?\_0xD3DBCE61A490BE02).**

## Usage

### Lua

```lua
TaskLeaveVehicle(ped, vehicle, flags)

-- always available, by hash
Citizen.InvokeNative(0x7b1141c6, ped, vehicle, flags)
```

### JavaScript

```js
TaskLeaveVehicle(ped, vehicle, flags);

// by hash
Citizen.invokeNative('0x7b1141c6', ped, vehicle, flags);
```

### C#

```csharp
Function.Call((Hash)0x7b1141c6, ped, vehicle, flags);
```

*Sources: Cfx.re native reference.*
