Quote:
Originally Posted by Backstabnoob
PHP Code:
new Float:flDamage; if( get_user_team( index ) == 1 ) { flDamage = ( Dmg * g_iCvars[ TR ][ iHitGroup ] / 100 ); } else if( get_user_team( index ) == 2 ) { flDamage = ( Dmg * g_iCvars[ CT ][ iHitGroup ] / 100 ); } SetHamParamFloat( 4, flDamage );
=>
PHP Code:
SetHamParamFloat( 4, Dmg * g_iCvars[ get_user_team( index ) == 1 ? TR : CT ][ iHitGroup ] / 100 );
You don't need to cache the cvars, but I'll leave that up to you as it doesn't matter at all here.
|
Thanks you know I never thought of that lol.
Will add to update.
EDIT:
might keep the cache as im going to add TK, and Self damage % to hitzones in next update and also a cfg file for cvars
__________________