Raised This Month: $12 Target: $400
 3% 

Solved [ H3LP ] Bit-fields through native


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-27-2018 , 18:02   [ H3LP ] Bit-fields through native
Reply With Quote #1

Hello, I'm trying to pass bit-field through a native and verify if exists. So basically this is what I'm trying but it's not working properly.

Register weapons plugin
Spoiler


Native plugin
Spoiler
__________________









Last edited by CrazY.; 06-27-2018 at 18:29.
CrazY. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-27-2018 , 18:19   Re: [ H3LP ] Bit-fields through native
Reply With Quote #2

What is the issue? And you will get faster help, from me at least, if you post enough code for me to paste into an IDE and compile. Leaving out variables and functions makes it more time consuming to plug in to get it to compile and troubleshoot.
__________________
Bugsy is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-27-2018 , 18:26   Re: [ H3LP ] Bit-fields through native
Reply With Quote #3

Thanks @Bugsy but the problem is in how I initialized the variable.

Code:
new bitsWeapons = -1



Code:
new bitsWeapons

Now it's working fine.
__________________









Last edited by CrazY.; 06-27-2018 at 18:26.
CrazY. is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-28-2018 , 04:49   Re: [ H3LP ] Bit-fields through native
Reply With Quote #4

If you haven't yet figured out why that is, it's because -1 is "all bits set", where 0 is "none of the bits set".
__________________
klippy is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-28-2018 , 08:49   Re: [ H3LP ] Bit-fields through native
Reply With Quote #5

Ok, thanks.
__________________








CrazY. is offline
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 07:26.


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