AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bitsums problem (https://forums.alliedmods.net/showthread.php?t=326195)

Shadows Adi 07-21-2020 19:56

Bitsums problem
 
Hello,
I have this bitsum:
Code:
#define AddState(%1,%2)  ( %1 =| ( 1 << (%2) & 31 ) )

but it throws me an error:
Code:
public client_connect(id) {     AddState(g_bitIsFirst, id); }

Errors:
PHP Code:

C:\Users\Adi\Desktop\addons2\amxmodx\scripting\give_things.sma(1072) : error 029invalid expressionassumed zero
C
:\Users\Adi\Desktop\addons2\amxmodx\scripting\give_things.sma(1072) : warning 215expression has no effect
C
:\Users\Adi\Desktop\addons2\amxmodx\scripting\give_things.sma(1072) : error 001expected token";"but found ")"
C:\Users\Adi\Desktop\addons2\amxmodx\scripting\give_things.sma(1072) : error 029invalid expressionassumed zero
C
:\Users\Adi\Desktop\addons2\amxmodx\scripting\give_things.sma(1072) : fatal error 107too many error messages on one line 


fysiks 07-21-2020 20:38

Re: Bitsums problem
 
"=|" is not valid, it should be "|="

Also, you can check out known working bitwise macros in Bugsy's tutorial: Bit-fields, and Bit-wise Operators. Yours is identical, in function to SetPlayerBit().

Shadows Adi 07-21-2020 20:52

Re: Bitsums problem
 
Oh, thanks.
Before this, I read this tut
https://forums.alliedmods.net/showthread.php?t=90507


All times are GMT -4. The time now is 13:50.

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