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

NPC_GetPathPointCount

எச்சரிக்கை

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

Description​

Gets the number of points in an NPC path.

NameDescription
pathidThe ID of the path

Returns​

Returns the number of points in the path, or 0 if the path is invalid.

Examples​

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkpathpointcount", true))
{
new pathid = PlayerPatrolPath[playerid];
if (pathid == INVALID_PATH_ID)
return SendClientMessage(playerid, 0xFFFF00FF, "No patrol path assigned.");

new count = NPC_GetPathPointCount(pathid);

SendClientMessage(playerid, 0x00FF00FF, "Path %d has %d points", pathid, count);
return 1;
}
return 0;
}

Notes​

  • Returns 0 if the path is invalid or empty