Usage of many inlcudes? - 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: Discussion (
https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: Usage of many inlcudes? (
/showthread.php?tid=577527)
Usage of many inlcudes? -
Ritzy2K - 12.06.2015
uses of many includes? mess up the script? i once used many includes and i got crap load of errors for nothing :/ is there a limit for maximum includes?
Re: Usage of many inlcudes? -
MohammedZ - 12.06.2015
Really Nigga xD ?
EDIT: I dont think so as you can put infinite Includes
Re: Usage of many inlcudes? -
KamalBa - 12.06.2015
Nah maybe you miss the Files yesterday i got the same problem
1- open your server Folder, go to include and put the files...
2-After that go to pawno and click on include folder and put the files again and it may be fixed
correct me if I am wrong
Re: Usage of many inlcudes? -
Pottus - 12.06.2015
I would counter that the usage of too few includes messes up a script but an error in one can cause a cascade failure of others. This is why you always fix the
FIRST error then recompile.
Re: Usage of many inlcudes? -
Yashas - 13.06.2015
You probably got errors because your includes had dependent code(this include depends on another include).
When you make includes, you must ensure that they work independently.Or you'll have to include two or more includes which makes no sense.The purpose of using includes is lost.
Make includes like when you have lot of defines/strings/etc which you are going to use in difference scripts.
For example,
#define TEAM_A 1
#define TEAM_B 2
const TeamStrings[][] =
{
"none", "Team A",Team B"
};
Keep such codes in an include.It will help you with inter-script communication.
Re: Usage of many inlcudes? -
Excips - 13.06.2015
Who told you includes are meant to be independent?
And I recommend to keep arrays and defines in the main mode so it's easy to edit, read, or write.
Re: Usage of many inlcudes? - Emmet_ - 13.06.2015
No, there is no limit for includes. If there was then modular scripts would be impossible.
#include simply reads the output of the included file and appends it to your gamemode upon .AMX compilation. If you have errors from using a lot of includes, then one of them probably has some faulty code (e.g. improper hooking, colliding with existing variables/function names, etc).
Re: Usage of many inlcudes? -
Ritzy2K - 13.06.2015
Thanks.