I rebuilt the plugin, because it wasn't firing the way I had written it. I can't tell if my new method is working, exactly, because this new setup somehow disables the hit-noise and damage-display: I can't see the numbers pop up over what I'm shooting, though I'm still doing damage. How do I re-enable broadcasting (which I assume I somehow
disabled)?
PHP Code:
HookEvent("player_hurt", TakeDamageHook, EventHookMode_Pre);
public Action:TakeDamageHook(Handle:event, const String:name[], bool:dontBroadcast) {
if(!CvarMasterSwitch) return Plugin_Continue;
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
new damage = GetEventInt(event, "damageamount");
if(TF2_IsPlayerInCondition(attacker, TFCond_OnFire)) {
new d = damage;
damage *= 0.8;
PrintToChatAll("%d -> %f", d, damage);
SetEventInt(event, "damageamount", RoundToNearest(damage * 0.8));
return Plugin_Changed;
}
else return Plugin_Continue;
}