OnNPCFinishMovePathPoint
cảnh báo
Đã thêm hàm trong phiên bản omp v1.5.8.3079. Mục này không hoạt động trên các phiên bản cũ hơn!
Description
This callback is called when an NPC finishes moving to a specific point in a path.
| Name | Description |
|---|---|
| npcid | The ID of the NPC that finished the path point |
| pathid | The ID of the path being followed |
| pointid | The index of the point that was reached |
Examples
public OnNPCFinishMovePathPoint(npcid, pathid, pointid)
{
// Find all players tracking this NPC
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if (!IsPlayerConnected(playerid))
continue;
if (PlayerNPC[playerid] == npcid)
{
SendClientMessage(playerid, 0xFFFF00FF, "NPC %d reached point %d on path %d", npcid, pointid, pathid);
}
}
return 1;
}
Notes
- This callback is triggered for each point in the path
- Use OnNPCFinishMovePath to detect when the entire path is completed
- The NPC must be moving along a path using NPC_MoveByPath
Related Functions
- NPC_MoveByPath: Make NPC follow a path
- NPC_CreatePath: Create a new path
- NPC_AddPointToPath: Add a point to a path
- NPC_GetCurrentPathPointIndex: Get current path point
Related Callbacks
- OnNPCFinishMovePath: Called when NPC finishes entire path
- OnNPCFinishMove: Called when NPC finishes any movement