---
title: "NPC_GetFightingStyle | open.mp"
description: "Obtém o estilo de luta de um NPC."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetFightingStyle
language: pt-BR
---

# NPC\_GetFightingStyle

aviso

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

## Descrição

Obtém o estilo de luta de um NPC.

| Nome | Descrição |
| --- | --- |
| npcid | O ID do NPC |

## Retornos

Retorna o estilo de luta ID do NPC.

## Exemplos

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/checkfightingstyle", 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 style = NPC_GetFightingStyle(npcid);

        SendClientMessage(playerid, 0x00FF00FF, "NPC %d fighting style: %d", npcid, style);
        return 1;
    }
    return 0;
}
```

## Notas

-   Os estilos de luta afetam as animações e os danos do combate corpo a corpo
-   Cada estilo tem diferentes animações de socos e chutes
-   O estilo de luta padrão é FIGHT\_STYLE\_NORMAL

## Funções Relacionadas

-   [NPC\_SetFightingStyle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_SetFightingStyle): Definir estilo de luta NPC
-   [NPC\_MeleeAttack](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_MeleeAttack): Faça NPC realizar ataque corpo a corpo
-   [NPC\_IsMeleeAttacking](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_IsMeleeAttacking): Verifique se NPC está atacando

## Callbacks Relacionadas

-   [OnNPCGiveDamage](https://omp.itsneufox.com/pt-BR/docs/scripting/callbacks/OnNPCGiveDamage): Chamado quando NPC causa dano a alguém
