---
title: "NPC_IsVehicleSirenUsed | open.mp"
description: "Verifica se um NPC está usando a sirene do veículo."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_IsVehicleSirenUsed
language: pt-BR
---

# NPC\_IsVehicleSirenUsed

aviso

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

## Descrição

Verifica se um NPC está usando a sirene do veículo.

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

## Retornos

Retorna `true` se NPC estiver usando a sirene do veículo, caso contrário, `false`.

## Exemplos

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/checksirenused", 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 veh = NPC_GetVehicle(npcid);
        if (veh == INVALID_VEHICLE_ID)
            return SendClientMessage(playerid, 0xFFFF00FF, "NPC %d is not in any vehicle.", npcid);

        new bool:sirenUsed = NPC_IsVehicleSirenUsed(npcid);

        SendClientMessage(playerid, 0x00FF00FF, "NPC %d vehicle siren used: %s", npcid, sirenUsed ? "Yes" : "No");
        return 1;
    }
    return 0;
}
```

## Notas

-   Retorna `false` se NPC não estiver em um veículo
-   Funciona apenas para veículos que possuem sirenes (carros de polícia, ambulâncias, caminhões de bombeiros)
-   Os efeitos visuais e sonoros da sirene são visíveis para todos os jogadores

## Funções Relacionadas

-   [NPC\_UseVehicleSiren](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_UseVehicleSiren): Alternar sirene do veículo
-   [NPC\_GetVehicleID](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_GetVehicleID): Obtenha o veículo de NPC
-   [NPC\_PutInVehicle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_PutInVehicle): Coloque NPC no veículo
-   [NPC\_RemoveFromVehicle](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/NPC_RemoveFromVehicle): Remova NPC do veículo

## Callbacks Relacionadas

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