---
title: "IsPlayerInAnyVehicle | open.mp"
description: "Check if a player is inside any vehicle (as a driver or passenger)."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/IsPlayerInAnyVehicle
language: th
---

# IsPlayerInAnyVehicle

## คำอธิบาย

Check if a player is inside any vehicle (as a driver or passenger).

| Name | Description |
| --- | --- |
| playerid | The ID of the player to check. |

## ส่งคืน

1: The player is in a vehicle.

0: The player is not in a vehicle.

## ตัวอย่าง

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/invehicle", true) == 0)
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid, 0x00FF00AA, "You're in a vehicle.");
        }
        return 1;
    }
    return 0;
}
```

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

-   [IsPlayerInVehicle](https://omp.itsneufox.com/th/docs/scripting/functions/IsPlayerInVehicle): Check if a player is in a certain vehicle.
-   [GetPlayerVehicleSeat](https://omp.itsneufox.com/th/docs/scripting/functions/GetPlayerVehicleSeat): Check what seat a player is in.
