SA-MP Forums Archive
Writing gamemode in some files, like mta resources. W/ #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: Writing gamemode in some files, like mta resources. W/ #include? (/showthread.php?tid=581508)



Writing gamemode in some files, like mta resources. W/ #include? - AnthonyGates - 13.07.2015

Hello!
I got problems with my gamemode...

Код:
.pwn(11) : error 017: undefined symbol "getServerVersion"
init.pwn:
Код:
#include <a_samp>


#define RCRP_ComplieProtect
#include "../../gamemodes/rcrp_sources/config.pwn"
#include "../../gamemodes/rcrp_sources/functions.pwn"
main()
{
	print("samp@anthonygates: Red County Roleplay");
	print("samp@anthonygates: Written by Anthony Gates");
	printf("samp@anthonygates: Loading version %s", getServerVersion());
}
config.pwn:
Код:
#if !defined RCRP_ComplieProtect
	#error Nem jу fбjlt prуbбlsz fordнtani!! // if you try complie this file
#endif

//VERSION
#define MOD "RC-RP"
#define MAJOR 1
#define MINOR 0
#define PATCH 0
functions.pwn:
Код:
#if !defined RCRP_ComplieProtect
	#error Nem jу fбjlt prуbбlsz fordнtani!! // if you try complie this file
#endif

stock getServerVersion(){
	new output[] = "RC-RP x.x.xxx";
	format(output, sizeof(output), "%s %d.%d.%d",MOD,MAJOR, MINOR, PATCH);
	return output;
}
Any ideas?
Only the first "../../gamemodes/rcrp_sources/*.pwn" loading.


Re: Writing gamemode in some files, like mta resources. W/ #include? - Vince - 13.07.2015

Use backslashes. The Pawn compiler behaves weird if you use forward slashes and the include path is longer than 30 characters.


Re: Writing gamemode in some files, like mta resources. W/ #include? - AnthonyGates - 13.07.2015

Thank you!



Solved.