Pular para o conteúdo principal

NPC_SetWeaponSkillLevel

aviso

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

Descrição

Define o nível de habilidade com arma para um NPC.

NomeDescrição
npcidO ID do NPC
skillO tipo de habilidade com arma (WEAPONSKILL)
levelO nível de habilidade a ser definido (0-999)

Retornos

Retorna true em caso de sucesso, false em caso de falha.

Exemplos

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/setweaponskill ", 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 level = strval(cmdtext[16]);

NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_PISTOL, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_PISTOL_SILENCED, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_DESERT_EAGLE, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_SHOTGUN, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_MICRO_UZI, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_MP5, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_AK47, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_M4, level);
NPC_SetWeaponSkillLevel(npcid, WEAPONSKILL_SNIPERRIFLE, level);

SendClientMessage(playerid, 0x00FF00FF, "NPC %d all weapon skills set to %d", npcid, level);
return 1;
}
return 0;
}

Notas

  • A habilidade com a arma afeta a precisão e o comportamento de tiro
  • O nível de habilidade varia de 0 (ruim) a 999 (assassino)
  • Diferentes tipos de armas têm diferentes categorias de habilidades

Funções Relacionadas

Callbacks Relacionadas