---
title: "OnPlayerExitVehicle | open.mp"
description: "This callback is called when a player starts to exit a vehicle."
canonical: https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerExitVehicle
language: th
---

# OnPlayerExitVehicle

## คำอธิบาย

This callback is called when a player starts to exit a vehicle.

| Name | Description |
| --- | --- |
| playerid | The ID of the player that is exiting a vehicle. |
| vehicleid | The ID of the vehicle the player is exiting. |

## ส่งคืน

มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ

## ตัวอย่าง

```c
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new string[35];
    format(string, sizeof(string), "INFO: You are exiting vehicle %i", vehicleid);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
```

## บันทึก

warning

Not called if the player falls off a bike or is removed from a vehicle by other means such as using SetPlayerPos. You must use OnPlayerStateChange and check if their old state is PLAYER\_STATE\_DRIVER or PLAYER\_STATE\_PASSENGER and their new state is PLAYER\_STATE\_ONFOOT.

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [RemovePlayerFromVehicle](https://omp.itsneufox.com/th/docs/scripting/functions/RemovePlayerFromVehicle): Throw a player out of their vehicle.
-   [GetPlayerVehicleSeat](https://omp.itsneufox.com/th/docs/scripting/functions/GetPlayerVehicleSeat): Check what seat a player is in.
