---
title: "OnPlayerEnterCheckpoint | open.mp"
description: "This callback is called when a player enters the checkpoint set for that player."
canonical: https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerEnterCheckpoint
language: th
---

# OnPlayerEnterCheckpoint

## คำอธิบาย

This callback is called when a player enters the checkpoint set for that player.

| Name | Description |
| --- | --- |
| playerid | The player who entered the checkpoint. |

## ส่งคืน

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

## ตัวอย่าง

```c
//In this example, a checkpoint is created for the player when spawning,
//which creates a vehicle and disables the checkpoint.
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    CreateVehicle(520, 1982.6150, -221.0145, -0.2432, 82.2873, -1, -1, 60000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
```

## บันทึก

หมายเหตุ

NPC สามารถเรียก Callback นี้ได้

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

-   [SetPlayerCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/SetPlayerCheckpoint): Create a checkpoint for a player.
-   [DisablePlayerCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/DisablePlayerCheckpoint): Disable the player's current checkpoint.
-   [IsPlayerInCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/IsPlayerInCheckpoint): Check if a player is in a checkpoint.
-   [SetPlayerRaceCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/SetPlayerRaceCheckpoint): Create a race checkpoint for a player.
-   [DisablePlayerRaceCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/DisablePlayerRaceCheckpoint): Disable the player's current race checkpoint.
-   [IsPlayerInRaceCheckpoint](https://omp.itsneufox.com/th/docs/scripting/functions/IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint.
