How to include from a different folder - 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 to include from a different folder (
/showthread.php?tid=210621)
How to include from a different folder -
Sascha - 13.01.2011
Hi,
I added a HTTP function to my script, which works fine, however as my server is hosted on serverffs and there is no "pawno/include" directory, I need to upload it to another "include" folder which exists...
How can I use an include of another directory?
Example: main folder named: server
so how to include server/include/a_http.inc
Thanks for you help.
Re: How to include from a different folder -
Jochemd - 13.01.2011
Just with #include since includes get copied in the script when compiling.
Re: How to include from a different folder -
JaTochNietDan - 13.01.2011
Well it depends on where pawno.exe is located, if it's located in server/pawno then you can do:
pawn Код:
#include "../include/a_http.inc"
If it's not, then you'll have to write the full path of the include into the script.
Keep in mind that you don't need includes for the server, you only need them when compiling the script.
Re: How to include from a different folder -
Sascha - 13.01.2011
well I want to include from server/include
so would the ../include/a_http.inc
get that folder?
Re: How to include from a different folder -
Jochemd - 13.01.2011
pawn Код:
#include "../include/a_http.inc"
That way indeed
Re: How to include from a different folder -
JaTochNietDan - 13.01.2011
Quote:
Originally Posted by Sascha
well I want to include from server/include
so would the ../include/a_http.inc
get that folder?
|
Only if pawno.exe is located in a sub-directory in the same folder, like I said.
Re: How to include from a different folder -
Wyu - 13.01.2011
Why would you need to store includes on the server? They are required only when compiling, not at run-time