Raised This Month: $ Target: $400
 0% 

Problem SOLVED.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-05-2011 , 08:31   Problem SOLVED.
Reply With Quote #1

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

Last edited by Arkshine; 08-05-2011 at 10:23. Reason: Don't delete your posts, you are not alone, give the solution instead.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-05-2011 , 10:13   Re: Problem SOLVED.
Reply With Quote #2

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.
__________________
Bugsy is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-05-2011 , 10:37   Re: Problem SOLVED.
Reply With Quote #3

you can check damage not button
if damage over 50 - its attack2
if < 50 - slash .
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-05-2011 , 14:33   Re: Problem SOLVED.
Reply With Quote #4

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.

Last edited by OvidiuS; 08-05-2011 at 14:45.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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