Usage of many inlcudes?
#1

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?
Reply
#2

Really Nigga xD ?



EDIT: I dont think so as you can put infinite Includes
Reply
#3

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
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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).
Reply
#8

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)