---
title: "NPC_RemoveFromVehicle | open.mp"
description: "Remove um NPC do veículo atual."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_RemoveFromVehicle
language: pt-BR
---

# NPC\_RemoveFromVehicle

aviso

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

## Descrição

Remove um NPC do veículo atual.

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

## Retornos

Retorna `true` se NPC foi removido do veículo, caso contrário, `false`.

## Exemplos

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/npcremovefromvehicle", 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 bool:success = NPC_RemoveFromVehicle(npcid);

        SendClientMessage(playerid, 0x00FF00FF, "NPC %d removed from vehicle: %s", npcid, success ? "Success" : "Failed");
        return 1;
    }
    return 0;
}
```

## Notas

-   NPC aparecerá instantaneamente fora do veículo sem animação de saída
-   Use NPC\_ExitVehicle para saída animada
-   Retorna false se NPC não estiver em um veículo
-   A posição NPC será definida perto do veículo

## Funções Relacionadas

-   [NPC\_PutInVehicle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_PutInVehicle): Coloque NPC no veículo
-   [NPC\_ExitVehicle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_ExitVehicle): Faça NPC sair com animação
-   [NPC\_GetVehicleID](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetVehicleID): Obtenha o veículo de NPC
-   [NPC\_GetVehicleSeat](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetVehicleSeat): Obtenha o assento de NPC

## Callbacks Relacionadas

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