SDKHooks_TakeDamage Function

Applies damage to an entity

void SDKHooks_TakeDamage(int entity, int inflictor, int attacker, float damage, int damageType, int weapon, const float damageForce[3], const float damagePosition[3], bool bypassHooks)

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

Errors

Invalid entity, attacker, inflictor, or weapon entity.

Notes

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