SA-MP Forums Archive
while(FALSE); FALSE doesn't exist? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: while(FALSE); FALSE doesn't exist? (/showthread.php?tid=276042)



while(FALSE); FALSE doesn't exist? - Kwarde - 12.08.2011

Hello.
The title says it. I have that SendFormattedMessage (I named it simply SendMessage). This is it:
pawn Код:
#define SendMessage(%0,%1,%2,%3)    do{new str[128]; format(str, 128, %2, %3); SendClientMessage(%0, %1, str);}while(FALSE)
Using the includes:
pawn Код:
#include <a_samp>
#include <djson>
#include <filemanager>
#include <OPSP>
#include <sscanf2>
#include <streamer>
#include <whirlpool>
#include <zcmd>
(I don't know if that's important, I just posted it).

However, I used that SendMessage fine before at 0.3c RC3. Since the update to RC5 I get this error:
pawn Код:
C:\Users\Kevin\Desktop\SAMP\KRLG\gamemodes\KRLG.pwn(102) : error 017: undefined symbol "FALSE"
Does anyone has a proper solution? I don't wanna use by the way that include package thing of ******: I think it are too many includes if I just want one, compiling takes longer, and starting the server took longer. (I said this because of an include of Alex he made so you can make an easier thing of this).
I know there is also a SendClientMessageFormatted which use the #emit things, but that one's working neither since RC5 (Runtime error 22: Double initialised AMX or something)

Regards,
Kevin


Re: while(FALSE); FALSE doesn't exist? - [L3th4l] - 12.08.2011

Try this:
pawn Код:
#if !defined FALSE
    stock bool:FALSE = false;
#endif
IIRC, that's ******'s code.


Re: while(FALSE); FALSE doesn't exist? - Kwarde - 12.08.2011

Thanks, it worked - No errors anymore. Now I just have to test it IG (currently impossible)

Regards,
Kevin


Re: while(FALSE); FALSE doesn't exist? - Calgon - 12.08.2011

Just remember that casing matters, you'll probably get the same with 'TRUE'.


Re: while(FALSE); FALSE doesn't exist? - Kwarde - 12.08.2011

Indeed:
Quote:

C:\Users\Kevin\Desktop\SAMP\KRLG\gamemodes\KRLG.pw n(103) : error 017: undefined symbol "TRUE"


That's what you meant, right? (I'm not really good in English, I think.)


Re: while(FALSE); FALSE doesn't exist? - Vince - 12.08.2011

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
Try this:
pawn Код:
#if !defined FALSE
    stock bool:FALSE = false;
#endif
IIRC, that's ******'s code.
false == false and true == true. Simple as that. I don't know why someone would write an ugly ass code like that.
while(true) and while(1) will work by default; while(false) and while(0) will also work by default.


Re: while(FALSE); FALSE doesn't exist? - Kwarde - 12.08.2011

I tried 0/false and 1/true before posting this, it gave me a warning. Something with 'non-zero' or 'zero'