跳到主要内容

OnNPCFinishMovePath

注意

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 along a predefined path.

NameDescription
npcidThe ID of the NPC that finished the path
pathidThe ID of the path that was completed

Examples

public OnNPCFinishMovePath(npcid, pathid)
{
// Find all players tracking this NPC
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if (!IsPlayerConnected(playerid))
continue;

if (PlayerNPC[playerid] == npcid)
{
SendClientMessage(playerid, 0x00FF00FF, "NPC %d finished moving along path %d", npcid, pathid);
}
}
return 1;
}

Notes

  • This callback is triggered when an NPC reaches the final point of a path
  • The NPC stops moving automatically when this callback is called