AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem SOLVED. (https://forums.alliedmods.net/showthread.php?t=163930)

OvidiuS 08-05-2011 08:31

Problem SOLVED.
 
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 :D

Bugsy 08-05-2011 10:13

Re: Problem SOLVED.
 
Instead of deleting your topic title and posts, why not leave your question and post your solution to help others who had the same problem.

avril-lavigne 08-05-2011 10:37

Re: Problem SOLVED.
 
you can check damage not button
if damage over 50 - its attack2
if < 50 - slash .

OvidiuS 08-05-2011 14:33

Re: Problem SOLVED.
 
because later i found out that problem isn't that one wich i wrote here.
Acutally there wasn't any problem. It should work that way.


All times are GMT -4. The time now is 03:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.