RedM Natives

GET_ENTITY_HEALTH

Only works for vehicle and peds

Hash0x8E3222B7
Runtime nameGetEntityHealth
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

int GET_ENTITY_HEALTH(Entity entity);

Parameters

NameTypeDescription
entityEntity

The entity to check the health of

Returns int — If the entity is a vehicle it will return 0-1000 If the entity is a ped it will return 0-200 If the entity is an object it will return 0

Description

Cfx.re native reference

Only works for vehicle and peds

Usage

Lua
local retval = GetEntityHealth(entity)

-- always works, by hash
local retval = Citizen.InvokeNative(0x8e3222b7, entity, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetEntityHealth(entity);

// by hash
const retval = Citizen.invokeNative('0x8e3222b7', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x8e3222b7, entity);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.