Raised This Month: $ Target: $400
 0% 

user_has_weapon isn't working :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 09-27-2006 , 21:16   user_has_weapon isn't working :(
Reply With Quote #1

Hey all, i'm trying to make it so the user has to be holding the 12 guage shotgun in order for the code to continue. It does not continue though

Here is my code snippit:
Code:
if( (get_user_button(id) & IN_ATTACK2) && !(get_user_oldbutton(id) & IN_ATTACK2) && (user_has_weapon(id, CSW_M3, 1)) ) {     myFunction(id); }
hlstriker is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 09-27-2006 , 21:39   Re: user_has_weapon isn't working :(
Reply With Quote #2

Use http://www.amxmodx.org/funcwiki.php?go=func&id=156
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 09-27-2006 , 21:41   Re: user_has_weapon isn't working :(
Reply With Quote #3

Thanks
hlstriker is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-01-2006 , 13:07   Re: user_has_weapon isn't working :(
Reply With Quote #4

A bit late, but user_has_weapon does work.

You just have to leave out the bitfield, ie your code:
Code:
user_has_weapon(id, CSW_M3, 1)
Where I personally use user_has_weapon in one of my plugins and my code looks like this:
Code:
if(user_has_weapon(id, CSW_AK47))
Works flawlessly.

Just my .02 cents.
organizedKaoS is offline
s p l i t
Senior Member
Join Date: May 2006
Location: US, NC
Old 10-01-2006 , 15:45   Re: user_has_weapon isn't working :(
Reply With Quote #5

It doesn't work in this case b/c user_has_weapon does not check wether the user is actualy holding that weapon, just that they have it in inventory.
s p l i t is offline
Send a message via AIM to s p l i t Send a message via MSN to s p l i t
Reply



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 04:58.


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