AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   user_has_weapon isn't working :( (https://forums.alliedmods.net/showthread.php?t=45283)

hlstriker 09-27-2006 21:16

user_has_weapon isn't working :(
 
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); }

s p l i t 09-27-2006 21:39

Re: user_has_weapon isn't working :(
 
Use http://www.amxmodx.org/funcwiki.php?go=func&id=156

hlstriker 09-27-2006 21:41

Re: user_has_weapon isn't working :(
 
Thanks :)

organizedKaoS 10-01-2006 13:07

Re: user_has_weapon isn't working :(
 
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.

s p l i t 10-01-2006 15:45

Re: user_has_weapon isn't working :(
 
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.


All times are GMT -4. The time now is 04:58.

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