SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   #error doesn't appear on compile (https://forum.sa-mp.com/showthread.php?t=318501)

BrandyPenguin 15/02/2012 01:05 PM

#error doesn't appear on compile
 
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?

[MG]Dimi 15/02/2012 01:10 PM

Re: #error doesn't appear on compile
 
pawn Code:
#if included
instead of
pawn Code:
#if defined

BrandyPenguin 15/02/2012 01:14 PM

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

iPLEOMAX 15/02/2012 01:25 PM

Re: #error doesn't appear on compile
 
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.


All times are GMT. The time now is 04:41 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.