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

[SOLVED] Compilation Error + Bit-wise operator using help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 03-04-2016 , 05:54   [SOLVED] Compilation Error + Bit-wise operator using help
Reply With Quote #1

I was trying to learn something new stuff from [TUT] Bits, Bit-fields, and Bit-wise Operators made by Bugsy.

I don't know how much I learned but however I tried something like this.

PHP Code:
#include < amxmodx >
#include < amxmisc >

#define Mark(%1,%2)    (%1 |= (1<<(%2 & 31)));
#define Clear(%1,%2)    (%1 &= ~(1<<(%2 & 31)));
#define Check(%1,%2)    (%1 & (1<<(%2 & 31)));

new iTestBool;

public 
plugin_init( ) {
    
    
register_plugin"PLUGIN""VERSION""AUTHOR" );
    
    
register_clcmd"say /mark""cmdMark" );
    
register_clcmd"say /check""cmdCheck" );
    
register_clcmd"say /clear""cmdClear" );
    
}

public 
cmdMarkindex ) {
    
    
MarkiTestBoolindex ); // line no. 22
    
client_printindexprint_chat"MARKED" );
    
}

public 
cmdCheckindex ) {
    
    if( 
CheckiTestBoolindex ) ) { // line no. 29 
        
        
client_printindex print_chat"CHECKED SUCCESSFUL" )
    }
    
}

pubic cmdClearindex ) {
    
    
CleariTestBoolindex );
    
client_printindexprint_chat"CLEARED" );
    

and got stuck here.

Code:
addons\amxmodx\scripting\help_code.sma(22) : error 036: empty statement
addons\amxmodx\scripting\help_code.sma(29) : error 001: expected token: ")", but found ";"
addons\amxmodx\scripting\help_code.sma(29) : error 036: empty statement
addons\amxmodx\scripting\help_code.sma(29) : error 029: invalid expression, assumed zero
addons\amxmodx\scripting\help_code.sma(29) : fatal error 107: too many error messages on one line
__________________
All my work is here

Last edited by xxxperts; 03-04-2016 at 06:37. Reason: Typing mistake + SOLVED
xxxperts is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 03-04-2016 , 05:58   Re: Compilation Error + Bit-wise operator using help
Reply With Quote #2

NOTE: Please move this thread to Scripting Help Section. Because I posted it in Wrong Section. My Mistake.
__________________
All my work is here
xxxperts is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-04-2016 , 06:24   Re: Compilation Error + Bit-wise operator using help
Reply With Quote #3

PHP Code:
#define Mark(%1,%2)    (%1 |= (1<<(%2 & 31)));
#define Clear(%1,%2)    (%1 &= ~(1<<(%2 & 31)));
#define Check(%1,%2)    (%1 & (1<<(%2 & 31))); 
There should be no semicolons at ends of these lines.
klippy is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 03-04-2016 , 06:34   Re: Compilation Error + Bit-wise operator using help
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
PHP Code:
#define Mark(%1,%2)    (%1 |= (1<<(%2 & 31)));
#define Clear(%1,%2)    (%1 &= ~(1<<(%2 & 31)));
#define Check(%1,%2)    (%1 & (1<<(%2 & 31))); 
There should be no semicolons at ends of these lines.
+ Thanks KliPPy

First i tried without semicolon and still I coudn't compile it.

But real problem was these
PHP Code:
client_printindex print_chat"CHECKED SUCCESSFUL" 
I missed comma after index
__________________
All my work is here
xxxperts is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 03-04-2016 , 06:36   Re: Compilation Error + Bit-wise operator using help
Reply With Quote #5

Solved. Thanks to whoever moved thread to Scripting Section. _/\_
__________________
All my work is here
xxxperts 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 22:40.


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