| title |
OnNPCFinishMovePathPoint |
| sidebar_label |
OnNPCFinishMovePathPoint |
| description |
Called when an NPC finishes moving to a specific point in a path. |
| tags |
|
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 |
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;
}
- 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