View Single Post
psychonic

BAFFLED
Join Date: May 2008
Old 01-31-2011 , 10:51   Re: [TF2] Dodge & Resist
Reply With Quote #6

@ Tylerist

Before it can be approved, you need to load the common phrases translation file on plugin start or there will be errors if the target cannot be found.
Code:
LoadTranslations("common.phrases");

Some less-important stuff:
Consider adding lateload support for when the plugin is (re)loaded mid game (should just have to add looping through all clients at plugin start, adding the hook for those that are InGame).

Another suggestion, maybe add cvars for default dodge and default resistance (maybe even per class?)

Code:
if(!IsClientConnected(victim) || !IsClientInGame(victim)
Not critical, but IsClientInGame will return false if not connected, and a return a true on it implies connected so you can leave one check off.

Code:
damage *= 0;
Why not just = 0?

Code:
new Float:resist = 1.0 - (damageresist[victim]/100.0);
Is this giving the intended result? You're dividing an integer by a float.
I think it should be:
Code:
new Float:resist = 1.0 - (float(damageresist[victim])/100.0);
psychonic is offline