SA-MP Forums Archive
How can i make my own 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 can i make my own include (/showthread.php?tid=321700)



How can i make my own include - Ballu Miaa - 28.02.2012

Hello,

I want to write a new .inc file (include) which can be included in my GM! But the problem is i have write the code in an .inc file and saved it using notepad with the extension .inc but every time i try to include it in my Game Mode. It give's me an error saying "Cannot read from the file"

How can i fix it?

Do i need to compile the .inc file using any IDE? or something? do i need to build it?

How to start when making a new .inc file? Please someone help me understand this!

Thanks
Ballu Miaa



Re: How can i make my own include - MP2 - 28.02.2012

Includes are compiled with the script in which they are included. Make sure you don't have multiple versions of pawno.


Re: How can i make my own include - [HK]Ryder[AN] - 28.02.2012

As Mike said check that u don't have multiple versions of pawno. Because if you open the gamemode by double clicking it, it opens the last closed pawno so it is not necessary you would be having the .inc in that pawno directory too.
Solution - Start pawno.exe and then browse your gm script and compile.


Re: How can i make my own include - Tanush123 - 28.02.2012

Well include are just like filterscripts. Well i made a include of a dynamic rule maker and it was mysql so i thought of making this into a include so people don't need to define their mysql information on the Filterscript


Re: How can i make my own include - Ballu Miaa - 28.02.2012

I just want to add a Simple stock function into the Include? How can i do that? What should i start the include with then where should i write the stock function?

Multiple pawno? I didnt get ya properly. Thanks for the replies!


Re: How can i make my own include - suhrab_mujeeb - 28.02.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
I just want to add a Simple stock function into the Include? How can i do that? What should i start the include with then where should i write the stock function?

Multiple pawno? I didnt get ya properly. Thanks for the replies!
If you don't know what to use the include for, just leave it. :3
By multiple pawno, he means that make sure you don't have multiple copies of pawno in different folders. This means if you include your inc file in one pawno and run a script from another pawno, it would say cannot read from file..


Re: How can i make my own include - AWP Gaming - 28.02.2012

Are you just naming the include file with (filename.inc) ?? Try opening an existing include file, remove all the code in there, and paste your include script. Then 'Save As' (NOT 'SAVE'!!), and just rename it. Don't get confused by simply opening notepad and pasting your script. The easiest way to do it is by following this method.


Re: How can i make my own include - Tanush123 - 29.02.2012

Quote:
Originally Posted by AWP Gaming
Посмотреть сообщение
Are you just naming the include file with (filename.inc) ?? Try opening an existing include file, remove all the code in there, and paste your include script. Then 'Save As' (NOT 'SAVE'!!), and just rename it. Don't get confused by simply opening notepad and pasting your script. The easiest way to do it is by following this method.
Funny guy... The easiest way is to do this is
1. Do the coding in pawn
2. Compile and make sure you got no errors or warning
3. Rename the pawn and put .inc at the end then it will tell do you want to change format, click yes
4. Put the .inc in your includes and go to your gamemode
5. Add that include and see if you get no warnings or errors

The reason you have to first code this in pawno because you would not know if your going to get errors and warnings