SA-MP Forums Archive
#error doesn't appear on compile - 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)
+--- Thread: #error doesn't appear on compile (/showthread.php?tid=318501)



#error doesn't appear on compile - BrandyPenguin - 15.02.2012

I added to my include:
pawn Code:
#if !defined _Script_Init
    #define _Script_Init
#else  
    #error Double Include
    //#endinput
#endif
And for check it i add my GameMode:
pawn Code:
#include "Scripts/init.pwn"
#include "Scripts/init.pwn"
And i Will not get error when i compile.
What is wrong with this?


Re: #error doesn't appear on compile - [MG]Dimi - 15.02.2012

pawn Code:
#if included
instead of
pawn Code:
#if defined



Re: #error doesn't appear on compile - BrandyPenguin - 15.02.2012

What you mean with that?
When i add it on my include i get: Scripts/init.pwn(5) : error 017: undefined symbol "included"


Re: #error doesn't appear on compile - iPLEOMAX - 15.02.2012

No need to do that, just use:
pawn Code:
#if defined _Script_Init
      #endinput
#endif
Now, if you do:
pawn Code:
#include "Scripts/init.pwn"
#include "Scripts/init.pwn"
#include "Scripts/init.pwn"
#include "Scripts/init.pwn"
#include "Scripts/init.pwn"
Nothing will go wrong.