Ugrás a fő tartalomhoz

NPC_OpenNode

vigyázat

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

Description

Opens an NPC node for use, making it available for NPCs to navigate through.

NameDescription
nodeidThe ID of the node

Returns

Returns true if the node was opened successfully, false otherwise.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/npcopennode ", true, 13))
{
new nodeid = strval(cmdtext[13]);

if (nodeid < 0 || nodeid > 63)
return SendClientMessage(playerid, 0xFF0000FF, "Invalid node ID. Must be between 0 and 63.");

new bool:success = NPC_OpenNode(nodeid);

SendClientMessage(playerid, 0x00FF00FF, "Open node %d: %s", nodeid, success ? "Success" : "Failed");
return 1;
}
return 0;
}

Notes

  • Node IDs range from 0 to 63
  • Nodes must be opened before NPCs can use them for navigation
  • Opening a node loads its data and makes it accessible
  • Use NPC_IsNodeOpen to check if a node is already open

No specific callbacks are triggered by this function.