Client Kill Callback
Client Kill Callback
Adds a client sided callback triggered on the death of any player during a game
Note:
Thanks to Fifty#8113 and Spoon#1812 as they did most of the work on this.
For end users:
This alone does nothing but is required for other mods to function.
If another mod listed this one as its dependency, download it!
For modders:
AddClientCallback_OnPlayerKilled ( void functionref ( ObituaryCallbackParams {entity victim, entity attacker, int damageSourceId, int scriptDamageType} ) customCallback)
As of the latest update made by Uniboi, the callback functions require only one argument of the ObituaryCallbackParams type.
The struct currently contains:
- entity attacker
- entity victim
- int damageSourceId
- int scriptDamageType
- bool victimIsOwnedTitan
Example:
This will thread a function called myOnKillFunction every time the client player gets a player kill with the Kraber:
void function afterClientInit(){
AddCallback_OnPlayerKilled ( myCallbackFunction )
}
void function myCallbackFunction ( ObituaryCallbackParams inputParams ) {
if( inputParams.attacker == GetLocalClientPlayer() &&
DamageSourceIDToString(inputParams.damageSourceId) == "mp_weapon_sniper")
thread myOnKillFunction()
}
Comments

