View Single Post
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-10-2021 , 01:41   Re: Increase cvar by a code
Reply With Quote #5

Quote:
Originally Posted by Napoleon_be View Post
You'll need to update the damage everytime u kill a zombie then. use DeathMsg event or Ham_Killed. Use a variable to store the bonus damage in, and increase it using get_pcvar_num(). Hook TakeDamage & TraceAttack.

https://forums.alliedmods.net/showthread.php?t=80208 : This is a great example of how you could do it.
Actually i already have that in my forwardPlayerKilled...

Heres my code:
PHP Code:
// Zombie killed human, add up the extra frags for kill
    
if (g_zombie[attacker] && get_pcvar_num(cvar_fragsinfect) > 1)
        
set_pcvar_num(cvar_ammodamage_humanget_pcvar_num(cvar_ammodamage_human) +5)
        
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect) - 100

Last edited by HowToRuski; 04-10-2021 at 01:43.
HowToRuski is offline