PHP Code:
switch (g_level[attacker])
{
case (1): SetHamParamFloat(4, damage)
// . . .
case (20): SetHamParamFloat(4, damage*3.0)
}
PHP Code:
new const Float:damage_factor[LEVELS] = { 1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.9,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,3.0 }
SetHamParamFloat(4,damage * damage_factor[g_level[attacker]]))
I'm not 100% on this but I think I've seen optimizations like this before.
You could do something similar with weapon damage factor.
__________________