Pular para o conteúdo principal

NPC_StopPlayingNode

aviso

Esta função foi adicionada no omp v1.5.8.3079 e não funcionará em versões anteriores!

Descrição

Impede que um NPC reproduza seu nó atual.

NomeDescrição
npcidO ID do NPC

Retornos

Retorna true se NPC foi interrompido com sucesso, caso contrário, false.

Exemplos

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/npcstopnode", true))
{
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 bool:success = NPC_StopPlayingNode(npcid);

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

Notas

  • O NPC irá parar em sua posição atual no nó
  • Se NPC não estiver reproduzindo um nó, esta função retorna false
  • O nó permanece aberto e pode ser usado por outro NPCs
  • Use NPC_IsPlayingNode para verificar se um NPC está reproduzindo um nó

Funções Relacionadas

Callbacks Relacionadas