View Single Post
nosoop
Veteran Member
Join Date: Aug 2014
Old 02-19-2022 , 09:37   Re: [TF2] Hidden dev attributes
Reply With Quote #46

Quote:
Originally Posted by Zethax View Post
also if I could get some criticism on the code itself that'd be GREAT
Since you asked, I'd highly recommend using my fork of TF2Attributes. It's able to use the game's own functions for calculating attribute values in aggregate, so you don't have to iterate over client / weapons for the same effect nor retrieve the values manually.

e.g. with kill_with_any_weapon_heals, you could drop the loop and simplify the code down to
Code:
int iHealAmount = TF2Attrib_HookValueInt(0, "health_on_kill_any_weapon", iAttacker);
HealPlayer(iAttacker, iHealAmount, 1.5);
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 02-19-2022 at 09:41.
nosoop is offline