Help with include -
hoonz - 28.08.2017
Any ideas how could I include the file without changing the directories names?
this way is too long, mode is not reading the file.
Код:
#include "..\gamemodes\modules\fractions\firefighters\map.inc"
Re: Help with include -
Bingo - 28.08.2017
Just use #include <yourinclude.inc>
Make sure the include is in pawno/includes/
Plus i still didn't get your question so apologize.
Re: Help with include -
hoonz - 28.08.2017
Quote:
Originally Posted by Bingo
Just use #include <yourinclude.inc>
Make sure the include is in pawno/includes/
Plus i still didn't get your question so apologize.
|
I'm including files from gamemode directory, not from pawno.
Re: Help with include -
Misiur - 28.08.2017
Do you by any chance include another file (in any other folder) named "map"? If so, you have to remove include guards yourself
Re: Help with include -
hoonz - 28.08.2017
Quote:
Originally Posted by Misiur
Do you by any chance include another file (in any other folder) named "map"? If so, you have to remove include guards yourself
|
There are about 3 includes with "map.inc", but in different folders/path's
Re: Help with include -
Misiur - 28.08.2017
That doesn't matter, they still have the same name "map.inc". To fix this, there are two steps.
1. Drop the .inc from your #include, like so: #include "path\map"
2. On top of each map.inc file, add this:
pawn Код:
#if defined _inc_map
#undef _inc_map
#endif
Re: Help with include -
hoonz - 28.08.2017
Quote:
Originally Posted by Misiur
That doesn't matter, they still have the same name "map.inc". To fix this, there are two steps.
1. Drop the .inc from your #include, like so: #include "path\map"
2. On top of each map.inc file, add this:
pawn Код:
#if defined _inc_map #undef _inc_map #endif
|
What about using .pwn instead of .inc?
Re: Help with include -
Misiur - 28.08.2017
Then you'll hit this problem again, but you won't be able to remove the include guard. There's also third option exploting the compiler:
pawn Код:
#include "..\gamemodes\modules\fractions\firefighters/map"
Now the filename is "firefighters/map", so if all your other "map" includes are not in a firefighters folder (any, not necessarily this specific folder), then you are good to go. I won't recommend it as it can come back to haunt you, when one day you'll create a now module "stripclubs", in which there'll be "firefighters/map.inc" and you'll wonder why it is not included
Re: Help with include -
Vince - 28.08.2017
Quote:
Originally Posted by Bingo
Just use #include <yourinclude.inc>
Make sure the include is in pawno/includes/
Plus i still didn't get your question so apologize.
|
There are multiple reasons why some people do not want to use this folder. For example if the compiler is not in the server folder but somewhere else on disk entirely (e.g. in program files). In that case you don't want to clutter the include folder with files that are only used by one specific mode.
The angle brackets denote a "system" file according to the documentation and I think a system file should be treated as such. A map file is not a system file and therefore shouldn't use the angle brackets.