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(p = 1; p <= g_iMaxPlayers; p++)
{
if(p != 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(p = 1; p <= g_iMaxPlayers; p++)
{
if(p != 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!
__________________