getEntityHealth
GET_ENTITY_HEALTH0xEEF059FAD016D209The GTA V native GET_ENTITY_HEALTH of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityHealth, in JavaScript and in Lua.
getEntityHealth(entity: Entity): numbergetEntityHealth(entity: Entity): integerUsage
JavaScript
const result = getEntityHealth(entity);Lua
local result = getEntityHealth(entity)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
Returns
int JavaScript number, Lua integerNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns an integer value of entity's current health.
Example of range for ped:
- Player [0 to 200]
- Ped [100 to 200]
- Vehicle [0 to 1000]
- Object [0 to 1000]
Health is actually a float value but this native casts it to int.
Reference
- Namespace
- Entity ENTITY
- In the game
int GET_ENTITY_HEALTH(Entity entity)- Hash
0xEEF059FAD016D209