Quote:
Originally Posted by fysiks
Run it and see what happens. The code that you've shown is relatively small compared to many plugins that use these hooks. However, get_user_weapon() will not always get the weapon with which the damage was caused. For example, if when someone is injured by a grenade, the attacker might not be holding a grenade.
|
Thank you for you time. And that get_user_weapon() is what I am worried about, but not because the grenade problem, because there will be no Golden Grenades.
- It is because all the time that someone get injured they will be:
- An "if( attacker > 0 )", and ifs to the processor are bad.
- A "new currentSpecialWeapon = get_user_weapon(attacker, clip, ammo)", which I don't know if it is quick as access a local constant value, or if it has a lot of cost and should not be executed every use shot.
- Another "if( g_whichSpecialWeapon[attacker] == currentSpecialWeapon )", which access a array position and the currentSpecialWeapon got before at 2).
- Finally, the "SetHamParamFloat(4, damage * g_weapon_damage )", which I don't know how much costly is it/are Ham functions, specially this one.
Hence, are these steps light weight or heavy weight?
For now, I am keep follow what you said.
- A will keep analyzing my server performance and ping with it and without it.
- I will keep studying and getting to know better these functions/ifs performance impact.