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

Bitsums problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-21-2020 , 19:56   Bitsums problem
Reply With Quote #1

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 
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-21-2020 , 20:38   Re: Bitsums problem
Reply With Quote #2

"=|" 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().
__________________

Last edited by fysiks; 07-21-2020 at 20:39.
fysiks is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-21-2020 , 20:52   Re: Bitsums problem
Reply With Quote #3

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


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
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 11:26.


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