EntityClient

setEntityHealth

SET_ENTITY_HEALTH0x6B76DC1F3AE6E6A3

The 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.

SignatureJavaScript
setEntityHealth(
  entity: Entity,
  health: number,
  instigator: Entity,
  weaponType: Hash
): void
SignatureLua
setEntityHealth(
  entity: Entity,
  health: integer,
  instigator: Entity,
  weaponType: Hash
)

Usage

JavaScript
setEntityHealth(entity, health, instigator, weaponType);
Lua
setEntityHealth(entity, health, instigator, weaponType)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
healthintnumberinteger
instigatorEntitynumberinteger
weaponTypeHashnumberinteger

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

Open in the interactive natives reference