SDKHooks_TakeDamage

Last Updated2021-10-13
Created At2013-02-08

Applies damage to an entity

Notes

Force application is dependent on game and damage type(s)

native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker, float damage, int damageType = 0, int weapon = -1, const float damageForce[3] = NULL_VECTOR, const float damagePosition[3] = NULL_VECTOR, bool bypassHooks = true)

Parameters

int entity
Entity index taking damage
int inflictor
Inflictor entity index
int attacker
Attacker entity index
float damage
Amount of damage
int damageType
Bitfield of damage types
int weapon
Weapon index (orangebox and later) or -1 for unspecified
const float[3] damageForce
Velocity of damage force
const float[3] damagePosition
Origin of damage
bool bypassHooks
If true, bypass SDK hooks on OnTakeDamage

Return Value

void

Error

Invalid entity, attacker, inflictor, or weapon entity.