while(FALSE); FALSE doesn't exist?
#1

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
Reply
#2

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

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

Regards,
Kevin
Reply
#4

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

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.)
Reply
#6

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.
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)