Skip to main content

OnNPCFinishMovePathPoint

warning

This function was added in omp v1.5.8.3079 and will not work in earlier versions!

Description​

This callback is called when an NPC finishes moving to a specific point in a path.

NameDescription
npcidThe ID of the NPC that finished the path point
pathidThe ID of the path being followed
pointidThe 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