Pular para o conteúdo principal

NPC_SetSurfingObject

aviso

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

Descrição

Define o objeto em que um NPC está navegando.

NomeDescrição
npcidO ID do NPC
objectidO objeto ID

Retornos

Retorna true se a operação foi bem-sucedida, caso contrário, false.

Exemplos

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/setsurfingobject ", true, 18))
{
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 objectid = strval(cmdtext[18]);

NPC_SetSurfingObject(npcid, objectid);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d surfing object set to %d", npcid, objectid);

return 1;
}
return 0;
}

Notas

  • O NPC se moverá junto com o objeto se ele se mover
  • O objeto deve existir para que a navegação funcione corretamente

Funções Relacionadas

Callbacks Relacionadas

Nenhum callback específico é acionado por esta função.