Перейти к основному содержимому

NPC_UpdateNodePoint

warning

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

Description​

Updates an NPC to a specific point in the currently playing node.

NameDescription
npcidThe ID of the NPC
pointidThe point ID in the node to update to

Returns​

Returns true if the update was successful, false otherwise.

Examples​

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/npcupdatenodepoint ", true, 20))
{
new npcid = PlayerNPC[playerid];
if (npcid == INVALID_NPC_ID)
return SendClientMessage(playerid, 0xFF0000FF, "You are not debugging a NPC.");

if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "Invalid NPC.");

new pointid = strval(cmdtext[20]);

new bool:success = NPC_UpdateNodePoint(npcid, pointid);

SendClientMessage(playerid, 0x00FF00FF, "NPC %d update node point %d: %s", npcid, pointid, success ? "Success" : "Failed");
return 1;
}
return 0;
}

Notes​

  • The NPC must be currently playing a node
  • Point ID must exist in the current node
  • Use this to skip to specific waypoints in navigation
  • Useful for teleporting NPCs within their current path