---
title: "NPC_GetSpecialAction | open.mp"
description: "Obtém a ação especial atual de um NPC."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetSpecialAction
language: pt-BR
---

# NPC\_GetSpecialAction

aviso

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

## Descrição

Obtém a ação especial atual de um NPC.

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

## Retornos

Retorna a ação especial ID ou `SPECIAL_ACTION_NONE` se nenhuma ação especial estiver ativa.

## Exemplos

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

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

## Notas

-   Retorna a constante de ação especial atual
-   Use isto para verificar qual ação o NPC está executando atualmente

## Funções Relacionadas

-   [NPC\_SetSpecialAction](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_SetSpecialAction): Definir ação especial NPC
-   [NPC\_ClearAnimations](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_ClearAnimations): Limpar todas as animações
-   [NPC\_ApplyAnimation](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_ApplyAnimation): Aplicar animação a NPC

## Callbacks Relacionadas

-   [OnNPCSpawn](https://omp.itsneufox.com/pt-BR/docs/scripting/callbacks/OnNPCSpawn): Chamado quando NPC surge
