---
title: "NPC_GetVehicleGearState | open.mp"
description: "Obtém o estado do trem de pouso de uma aeronave NPC."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetVehicleGearState
language: pt-BR
---

# NPC\_GetVehicleGearState

aviso

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

## Descrição

Obtém o estado do trem de pouso de uma aeronave NPC.

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

## Retornos

Retorna o estado do trem de pouso da aeronave NPC (LANDING\_GEAR\_STATE\_DOWN ou LANDING\_GEAR\_STATE\_UP).

## Exemplos

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/checkvehiclegearstate", 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.");

        if (NPC_GetVehicle(npcid) == INVALID_VEHICLE_ID)
            return SendClientMessage(playerid, 0xFFFF00FF, "NPC %d is not in any vehicle.", npcid);

        new LANDING_GEAR_STATE:gearState = NPC_GetVehicleGearState(npcid);

        if (gearState == LANDING_GEAR_STATE_UP)
            SendClientMessage(playerid, 0x00FF00FF, "NPC %d: Landing gear UP", npcid);
        else
            SendClientMessage(playerid, 0x00FF00FF, "NPC %d: Landing gear DOWN", npcid);

        return 1;
    }
    return 0;
}
```

## Notas

-   Só funciona quando o NPC está pilotando uma aeronave
-   Retorna o estado atual do trem de pouso definido por NPC\_SetVehicleGearState
-   Usa as mesmas constantes que [Estados do trem de pouso do veículo](https://omp.itsneufox.com/pt-BR/docs/scripting/resources/landinggearstate): LANDING\_GEAR\_STATE\_DOWN e LANDING\_GEAR\_STATE\_UP
-   Este é o equivalente NPC de GetPlayerLandingGearState

## Funções Relacionadas

-   [NPC\_SetVehicleGearState](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_SetVehicleGearState): Definir estado do trem de pouso da aeronave
-   [GetPlayerLandingGearState](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/GetPlayerLandingGearState): Obtenha o estado do trem de pouso do jogador
-   [GetVehicleLandingGearState](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/GetVehicleLandingGearState): Obtenha o estado do trem de pouso do veículo
-   [NPC\_GetVehicle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetVehicle): Obtenha o veículo atual de NPC

## Recursos relacionados

-   [Estados do trem de pouso do veículo](https://omp.itsneufox.com/pt-BR/docs/scripting/resources/landinggearstate)

## Callbacks Relacionadas

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