View Single Post
Tylerst
Veteran Member
Join Date: Oct 2010
Old 02-01-2011 , 04:36   Re: [TF2] Dodge & Resist
Reply With Quote #7

Quote:
@ Tylerst
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.
Doh, thats usually one of the first things I add to OnPluginStart, can't believe I missed it.

Quote:
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.
Ah, I'll have to remember that, thanks.

Quote:
Code:
damage *= 0;
Why not just = 0?
Uh...good question?

Quote:
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);
That had been working for us. Good point nonetheless, I changed it.






Quote:
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?)
Before I start working on adding cvars...
Just to make sure, do you mean like this?
PHP Code:
public OnPluginStart()
{  
     for (new 
1<= MaxClientsi++)
     {
          if(
IsClientInGame(i)) 
          { 
                
SDKHook(iSDKHook_OnTakeDamageOnTakeDamage)
          }  
     }  


Unfortunately, my video card died last week, so I won't be able to test these changes for a little while, but I'll have it ready anyway.

Last edited by Tylerst; 02-01-2011 at 04:38.
Tylerst is offline