---
title: "OnPlayerObjectMoved | open.mp"
description: "This callback is called when a player object is moved after MovePlayerObject (when it stops moving)."
canonical: https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerObjectMoved
language: th
---

# OnPlayerObjectMoved

## คำอธิบาย

This callback is called when a player object is moved after MovePlayerObject (when it stops moving).

| Name | Description |
| --- | --- |
| playerid | The playerid the object is assigned to |
| objectid | The ID of the player object that was moved |

## ส่งคืน

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

## ตัวอย่าง

```c
public OnPlayerObjectMoved(playerid, objectid)
{
    printf("Player object moved: objectid: %d playerid: %d", objectid, playerid);
    return 1;
}
```

## บันทึก

หมายเหตุ

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

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

-   [MovePlayerObject](https://omp.itsneufox.com/th/docs/scripting/functions/MovePlayerObject): Move a player object.
-   [IsPlayerObjectMoving](https://omp.itsneufox.com/th/docs/scripting/functions/IsPlayerObjectMoving): Check if the player object is moving.
-   [StopPlayerObject](https://omp.itsneufox.com/th/docs/scripting/functions/StopPlayerObject): Stop a player object from moving.
-   [CreatePlayerObject](https://omp.itsneufox.com/th/docs/scripting/functions/CreatePlayerObject): Create an object for only one player.
-   [DestroyPlayerObject](https://omp.itsneufox.com/th/docs/scripting/functions/DestroyPlayerObject): Destroy a player object.
