AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Bit-fields through native (https://forums.alliedmods.net/showthread.php?t=308624)

CrazY. 06-27-2018 18:02

[ H3LP ] Bit-fields through native
 
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

Bugsy 06-27-2018 18:19

Re: [ H3LP ] Bit-fields through native
 
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.

CrazY. 06-27-2018 18:26

Re: [ H3LP ] Bit-fields through native
 
Thanks @Bugsy but the problem is in how I initialized the variable.

Code:
new bitsWeapons = -1

:arrow:

Code:
new bitsWeapons

Now it's working fine.

klippy 06-28-2018 04:49

Re: [ H3LP ] Bit-fields through native
 
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".

CrazY. 06-28-2018 08:49

Re: [ H3LP ] Bit-fields through native
 
Ok, thanks.


All times are GMT -4. The time now is 12:15.

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