முதன்மை உள்ளடக்கத்துக்குச் செல்லவும்

NPC_SetNodePoint

எச்சரிக்கை

செயல்பாடு என்பது omp v1.5.8.3079 பதிப்பில் சேர்க்கப்பட்டது. இது முந்தைய பதிப்புகளில் இயங்காது!

Description​

Sets the current point index for an NPC node.

NameDescription
nodeidThe ID of the node
pointidThe point index in the node

Returns​

Returns true if the point was set successfully, false otherwise.

Examples​

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

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

new idx = 17;
while (cmdtext[idx] != ' ' && cmdtext[idx] != '\0') idx++;
while (cmdtext[idx] == ' ') idx++;

if (cmdtext[idx] == '\0')
return SendClientMessage(playerid, 0xFF0000FF, "Usage: /npcsetnodepoint [nodeid] [pointid]");

new pointid = strval(cmdtext[idx]);

new bool:success = NPC_SetNodePoint(nodeid, pointid);

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

Notes​

  • Node must be opened before setting points
  • Point indices typically start from 0
  • Use NPC_GetNodePointPosition to retrieve point coordinates

No specific callbacks are triggered by this function.