---
title: "GetVehicleHealth | open.mp"
description: "Dobij healthe vozila."
canonical: https://omp.itsneufox.com/bs/docs/scripting/functions/GetVehicleHealth
language: bs
---

# GetVehicleHealth

## Deskripcija

Dobij healthe vozila.

| Ime | Deskripcija |
| --- | --- |
| vehicleid | ID vozila za dobiti healthe. |
| &Float:health | Float varijabla za pohraniti healthe vozila, proslijeđeno referencom |

## Returns

1 - uspješno

0 - greška (nevažeći ID vozila).

Healthi vozila su pohranjeni u varijablama, ne u return vrijednosti.

## Primjeri

```c
if (strcmp(cmdtext, "/repair", true) == 0)
{
    new
        Float: vehicleHealth,
        playerVehicleId = GetPlayerVehicleID(playerid);

    GetVehicleHealth(playerVehicleId, vehicleHealth);

    if (vehicleHealth > 500)
    {
        return SendClientMessage(playerid, COLOR_RED, "Vozilo ne treba popravak!");
    }

    SetVehicleHealth(playerVehicleId, 1000);
    SendClientMessage(playerid, COLOR_GREEN, "Vozilo popravljeno!");
}
```

## Zabilješke

note

-   Potpuno health stanje vozila je 1000, međutim moguće su veće vrijednosti i povećavaju health stanje vozila. Za više informacija o health vrijednostima pogledajte [ovdje](https://omp.itsneufox.com/bs/docs/scripting/resources/vehiclehealth).
-   Vozilo se zapali kad mu je health ispod 250. Eksplodirat će nekoliko sekundi kasnije.

## Srodne Funkcije

-   [SetVehicleHealth](https://omp.itsneufox.com/bs/docs/scripting/functions/SetVehicleHealth): Postavi helte vozila.
-   [GetPlayerHealth](https://omp.itsneufox.com/bs/docs/scripting/functions/GetPlayerHealth): Doznaj koliko healtha ima igrač.
-   [GetPlayerArmour](https://omp.itsneufox.com/bs/docs/scripting/functions/GetPlayerArmour): Otkrijte koliko armora ima igrač.
