Пређи на главни садржај

NPC_IsValidPath

warning

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

Description

Checks if a path ID is valid and exists.

NameDescription
pathidThe ID of the path

Returns

Returns true if the path is valid, false otherwise.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/checkvalidpath ", true, 16))
{
new pathid = strval(cmdtext[16]);

new bool:isValidPath = NPC_IsValidPath(pathid);

SendClientMessage(playerid, 0x00FF00FF, "Path %d is valid: %s", pathid, isValidPath ? "Yes" : "No");
return 1;
}
return 0;
}

Notes

  • Always check if a path is valid before using it with NPCs
  • Invalid paths may have been destroyed or never created properly
  • Use this before adding points or assigning paths to NPCs
  • Path IDs are reused when paths are destroyed

No specific callbacks are triggered by this function.