setEntityHealth
SET_ENTITY_HEALTH0x6B76DC1F3AE6E6A3The GTA V native SET_ENTITY_HEALTH of the ENTITY namespace, as LS:MP client scripts call it: the global function setEntityHealth, in JavaScript and in Lua.
setEntityHealth(
entity: Entity,
health: number,
instigator: Entity,
weaponType: Hash
): voidsetEntityHealth(
entity: Entity,
health: integer,
instigator: Entity,
weaponType: Hash
)Usage
JavaScript
setEntityHealth(entity, health, instigator, weaponType);Lua
setEntityHealth(entity, health, instigator, weaponType)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
health | int | number | integer |
instigator | Entity | number | integer |
weaponType | Hash | number | integer |
Returns
Nothing. In JavaScript the call evaluates to undefined.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
health >= 0
male ped ~= 100 - 200
female ped ~= 0 - 100
Reference
- Namespace
- Entity ENTITY
- In the game
void SET_ENTITY_HEALTH(Entity entity, int health, Entity instigator, Hash weaponType)- Hash
0x6B76DC1F3AE6E6A3