I'm editing XP mod, so i have problem, and i don't know how to solve it.
If player choose class (Marine, Assassin, Predator, Sniper, or he has item number 8, he should kill with one knife stab (right click, ATTACK2)
Code:
if(player_item[idattacker][0] == 8 || (player_class[idattacker] == Sniper && random_num(1,2) == 1) || player_class[idattacker] == Marine || player_class[idattacker] == Predator || player_class[idattacker] == Assassin && (get_user_button(idattacker) & IN_ATTACK2))
damage = float(health);
I registered that code in
Code:
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
The problem is, that they can kill with one left click, slash
Any idea where is the problem??
I even tried to add this
Code:
!(get_user_button(idattacker) & IN_ATTACK)
but it didn't helped.
Only Assassin kills with one knife stab, not slash