Pular para o conteúdo principal

NPC_SetFacingAngle

aviso

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

Descrição

Define o ângulo de face de um NPC.

NomeDescrição
npcidO ID do NPC.
Float:angleO ângulo de face em graus (0-360).

Retornos

Retorna true se o ângulo de face foi definido com sucesso, caso contrário, false.

Exemplos

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/setfacingangle ", true, 16))
{
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 Float:angle = floatstr(cmdtext[16]);
if (angle < 0.0 || angle > 360.0)
return SendClientMessage(playerid, 0xFF0000FF, "Angle must be between 0.0 and 360.0.");

NPC_SetFacingAngle(npcid, angle);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d facing angle set to %.1f", npcid, angle);

return 1;
}
return 0;
}

Notas

aviso
  • O ângulo é medido em graus (0-360).
  • Use NPC_GetFacingAngle para obter o ângulo de face atual.
  • Gira instantaneamente NPC sem animação.

Funções Relacionadas