跳到主要內容

OnNPCFinishMovePath

注意

此函式於 omp v1.5.8.3079 版本中新增,在更早的版本中無法使用!

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