View Single Post
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna know...
Old 04-30-2009 , 16:37   Re: Kill assist
Reply With Quote #20

Really nice plugin, the code is extremely clean and just easy to read from. ;)

I have a few notes/questions though(probably stupid ones):

1) About iMinDamage = ch_pCVar_minDamage, why creating an extra var when you can just call it from first place iMinDamagePCVar or something?

2) About g_iDamage[p][iVictim] > iMinDamage, since it's the minimum damage, shouldn't it be: g_iDamage[p][iVictim] >= iMinDamage?

3) I think that this:
PHP Code:
for(1<= g_iMaxPlayersp++)
        {
            if(
!= iKiller && g_bOnline[p] && iKillerTeam == get_user_team(p) && g_iDamage[p][iVictim] > iMinDamage && g_iDamage[p][iVictim] > iDamage2)
            {
                
iKiller2 p
                iDamage2 
g_iDamage[p][iVictim]
                
g_iDamage[p][iVictim] = 0
            
}
        } 
should be like this:
PHP Code:
for(1<= g_iMaxPlayersp++)
        {
            if(
!= iKiller && g_bOnline[p] && iKillerTeam == get_user_team(p) && g_iDamage[p][iVictim] > iMinDamage && g_iDamage[p][iVictim] > iDamage2)
            {
                
iKiller2 p
                iDamage2 
g_iDamage[p][iVictim]
            }
            
            
g_iDamage[p][iVictim] = 0
        

since the victim already died...

4) I think you should create a global var to check the players' teams when they join a cretain team because not only that you use get_user_team everytime a player dies, you also use a loop and inside the loop you use that native so I just thought maybe it would be more efficient to create a global var instead...

5) Finally, I'd like to suggest you to add friendly fire compatibility. ;)


Sorry for nagging and nice plugin!
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline