RedM Natives

SET_ENTITY_HEALTH

Sets the entity's health.

Hash0xAC2767ED8BDFAB15
Runtime nameSetEntityHealth
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207

Signature

void SET_ENTITY_HEALTH(Entity entity, int healthAmount, Entity entityKilledBy);

Parameters

NameTypeDescription
entityEntity—
healthAmountint—
entityKilledByEntity—

Returns void

Description

Sets the entity's health. healthAmount sets the health value to that, and sets the maximum health core value. Setting healthAmount to 0 will kill the entity. entityKilledBy parameter can also be 0

Usage

Lua
SetEntityHealth(entity, healthAmount, entityKilledBy)

-- always works, by hash
Citizen.InvokeNative(0xAC2767ED8BDFAB15, entity, healthAmount, entityKilledBy)
JavaScript and C#
JavaScript
SetEntityHealth(entity, healthAmount, entityKilledBy);

// by hash
Citizen.invokeNative('0xAC2767ED8BDFAB15', entity, healthAmount, entityKilledBy);
C#
Function.Call((Hash)0xAC2767ED8BDFAB15, entity, healthAmount, entityKilledBy);

See also

Sources

alloc8or RDR3 NativeDB

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