Hey guys, I'm having a bit of a problem with this plugin I've been working on.. I can't seem to emulate TF2 kills perfectly.
What I'm doing is hooking into SDKHook_OnTakeDamage, cancelling the damage by returning Plugin_Handled, and inside this hook calling SDKHooks_TakeDamage to damage the attacker instead.
The issue? SDKHooks_TakeDamage does not have a customkill parameter. Special flags like whether a backstab or headshot has occured can't be carried over to the attacker.
... and yet SDKHook_OnTakeDamage does have a customkill parameter.
Any help would be
greatly appreciated!
Thanks,
Mark.
Some code examples:
Code:
SDKHook(clientID, SDKHook_OnTakeDamage, OnClientTakeDamage); // Here I would hook the damage method.
public Action:OnClientTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weapon, Float:damageForce[3], Float:damagePosition[3], damagecustom)
{
// No damagecustom in SDKHooks_TakeDamage, wtf?
SDKHooks_TakeDamage(attacker, inflictor, victim, damage, damagetype, weapon, damageForce, damagePosition);
return Plugin_Handled;
}
__________________