SA-MP Forums Archive
how to compile include - 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: how to compile include (/showthread.php?tid=392752)



how to compile include - Sam5513 - 15.11.2012

Hey.
Ive been searching all over ****** but I cant find answer to my question. How do I compile a include file for SAMP? if I just paste it in pawno, it gives me weird errors, probabbly because pawno is ment for amx. Any program? Thank you.


Re: how to compile include - sleepysnowflake - 15.11.2012

Yes - you do not compile includes. Do you even know what an include is? I'll try and explain it to you.

pawn Код:
This is your INCLUDE FILE:
stock RandomFunc(randarg)
{
//random shizzle
return something;
}
// now here ends your inc.

// let's say you put it something like:

main()
{
return 1;
}
#include <yourinclude>

// now this is the same as doing:

main()
{
return 1;
}

stock RandomFunc(randarg)
{
//random shizzle
return something;
}

// the compiler basically reads it that way, he, let's say, unifies the two codes.
Hope it helped.


Re: how to compile include - Sam5513 - 15.11.2012

Hey. Thanks for fast response. Im not sure I quite understand. The includes I have so file are only added by doing something like
Код:
#include myfile
But with what I see in your code it looks much more complicated than what I am used to. To be exact, I wanted to use this include http://pastebin.com/f68e1a6ad
So, any quick hint on how to compile it? I apologize for my bad understandings. Thanks for your effort and rep++ for respoding. Thanks


Re: how to compile include - Vince - 15.11.2012

Include files needn't be compiled. They are included (get it?) when you compile your main script.


Re: how to compile include - sleepysnowflake - 15.11.2012

You don't need to compile it. Make a new file with the .inc extension and put the text in it then leave it in the pawno\includes folder. Open your GM and add #include <yourinclude> on top.


Re: how to compile include - Sam5513 - 15.11.2012

Oh, so can I create the new file just in notepad and save the extension as .inc?


Re: how to compile include - sleepysnowflake - 15.11.2012

Yes.


Re: how to compile include - Sam5513 - 15.11.2012

Thank you so much. Both of you. Really! Thanks!


Re: how to compile include - Face9000 - 15.11.2012

Don't need to compile your includes. Just create a new .inc file and start writing code inside it.