AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   #defined stuff needs to be splitted? (https://forums.alliedmods.net/showthread.php?t=162202)

bibu 07-16-2011 06:02

#defined stuff needs to be splitted?
 
This doesn't compile for me:

PHP Code:

            if( !( iFlags FL_ONGROUND )
            
#if defined DUCK
            
&& ( iFlags FL_DUCKING ) )
            
#else
            
&& get_user_buttoniToucher ) & IN_USE )
            
#endif 

But the exactly same code, like this, does:

PHP Code:

            #if defined DUCK
            
if( !( iFlags FL_ONGROUND )
            && ( 
iFlags FL_DUCKING ) )
            
#else
            
if( !( iFlags FL_ONGROUND )
            && 
get_user_buttoniToucher ) & IN_USE )
            
#endif 


ConnorMcLeod 07-16-2011 06:17

Re: #defined stuff needs to be splitted?
 
Put the last ")" out of the defines statements.

bibu 07-16-2011 07:31

Re: #defined stuff needs to be splitted?
 
This won't help me, still would not compile, I made it like this, but still doesn't work:

PHP Code:

            if( !( iFlags FL_ONGROUND ) )
            
#if defined DUCK
            
&& ( iFlags FL_DUCKING ) )
            
#else
            
&&  ( get_user_buttoniToucher ) & IN_USE )
            
#endif 

Last line got:

Quote:

Error: Invalid expression, assumed zero.

ConnorMcLeod 07-16-2011 08:53

Re: #defined stuff needs to be splitted?
 
You have an extra ")" on first line...

bibu 07-16-2011 09:52

Re: #defined stuff needs to be splitted?
 
Forget it.

Hunter-Digital 07-16-2011 10:26

Re: #defined stuff needs to be splitted?
 
Forget it meaning you solved it or forget it because he didn't understand ?

EDIT: oh nvm, my bad xD

Bugsy 07-16-2011 10:39

Re: #defined stuff needs to be splitted?
 
I tried too without success, it may not be syntactically possible.

bibu 07-16-2011 10:48

Re: #defined stuff needs to be splitted?
 
Quote:

Originally Posted by Hunter-Digital (Post 1511851)
forget it because he is telling the same and it doesn't work


rhelgeby 07-16-2011 10:59

Re: #defined stuff needs to be splitted?
 
What about this?

PHP Code:

            if( !( iFlags FL_ONGROUND )
            
#if defined DUCK
            
&& ( iFlags FL_DUCKING )
            
#else
            
&& get_user_buttoniToucher ) & IN_USE
            
#endif
            



bibu 07-16-2011 14:02

Re: #defined stuff needs to be splitted?
 
Nope...

I think I will leave it how I made it in my first post. Maybe bugsy is right about that.


All times are GMT -4. The time now is 01:08.

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