SA-MP Forums Archive
How can i make an 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i make an include? (/showthread.php?tid=187029)



How can i make an include? - CSMajor - 31.10.2010

How do i make an include? like a include that includes functions. Like dudb -.- but not exactly.


Re: How can i make an include? - Hiddos - 31.10.2010

Save a file under the .inc filetype, I'd suggest going to File > Save as > <file.inc>


Re: How can i make an include? - CSMajor - 31.10.2010

...... i know how to do that, thats not what i mean..... how do i script one not save a file.....


Re: How can i make an include? - Saurik - 31.10.2010

you should really learn how to script in pawn first and then worry about includes.

includes are tough to make.


Re: How can i make an include? - The_Moddler - 31.10.2010

Just see others includes..


Re: How can i make an include? - MBX97 - 01.11.2010

i was asking that question too but i really didn't get any help so please give me and him some help cuz i want to put all my maps in includes but i can't ?? pplease help him and me


Re: How can i make an include? - CSMajor - 01.11.2010

im good at scripting in pawn im not a noob, i just never understood includes..... iv made my own login system, admin system, house system, and car registering to player system. just not an include.... lol


Re: How can i make an include? - Mauzen - 01.11.2010

I do not understand whats that hard about includes.
Just imagine them to be a part of your main code, just externalized into another file. To define the include as one, you mostly use the same "header", you can use the first lines of a_samp.inc or so.
Then all you have to do, is to add the code you like. This can be stocks, publics, timers.... On compile, the compilers just handles them, as if they were in the same file with the normal script.


Re: How can i make an include? - (SF)Noobanatior - 01.11.2010

just go
Код:
#if defined _something_included
#endinput
#endif

#define _something_included
#pragma library something

//then do functions and stuff here 

#endinput
//finishes it then just save as "something.inc"

then include the file and put it in the right folder 
#include <something.inc> //pawno/include folder
or
#include "something.inc" along side the gamemode you building
see? simple


Re: How can i make an include? - Las Venturas CNR - 01.11.2010

1. Make a pawn(o) script.
2. Instead of saving to the location as a .pwn, save it to the location as a .inc
3. To include, at the top of your script, use

pawn Код:
#include <your_include_name_here>