# CFX::GET_LAST_PED_IN_VEHICLE_SEAT

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

## Signature

```c
Entity GET_LAST_PED_IN_VEHICLE_SEAT(Vehicle vehicle, int seatIndex);
```

## Parameters

- `vehicle` (`Vehicle`) — The target vehicle.
- `seatIndex` (`int`) — See eSeatPosition declared in [`IS_VEHICLE_SEAT_FREE`](#\_0x22AC59A870E6A669).

## Returns

`Entity` — The last ped in the specified seat of the passed vehicle. Returns 0 if the specified seat was never occupied or the last ped does not exist anymore.

## Usage

### Lua

```lua
local retval = GetLastPedInVehicleSeat(vehicle, seatIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0xf7c6792d, vehicle, seatIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetLastPedInVehicleSeat(vehicle, seatIndex);

// by hash
const retval = Citizen.invokeNative('0xf7c6792d', vehicle, seatIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xf7c6792d, vehicle, seatIndex);
```

*Sources: Cfx.re native reference.*
