Q: Scripting practice
#3

Modular programming: https://sampforum.blast.hk/showthread.php?tid=597338
I have not seen a modular gamemode yet where the modules are put in .inc files or even in the include folder. I have no idea whether doing so is a bad practice (I doubt it is).

My layout:
Код:
\project_folder\gamemodes\
	gamemode.pwn
	gamemode.amx
	\project_folder\gamemodes\modules\
		\project_folder\gamemodes\modules\player\
			core.pwn
			connect.pwn
			disconnect.pwn
			spawn.pwn
And I include them like this:
PHP код:
#include "modules\player\core.pwn"
#include "modules\player\connect.pwn"
#include "modules\player\disconnect.pwn"
#include "modules\player\spawn.pwn" 
It's easy for me to distinguish libraries from gamemode modules doing it like this and I believe that's the only reason why it is done like this.

I could also put my modules in the include folder and include them like so:
PHP код:
#include <modules\player\core.pwn>
#include <modules\player\connect.pwn>
#include <modules\player\disconnect.pwn>
#include <modules\player\spawn.pwn> 
Reply


Messages In This Thread
Q: Scripting practice - by Uberanwar - 02.04.2016, 13:53
Re: Q: Scripting practice - by introzen - 02.04.2016, 13:55
Re: Q: Scripting practice - by AndySedeyn - 02.04.2016, 14:49
Re: Q: Scripting practice - by Vince - 02.04.2016, 16:29
Re: Q: Scripting practice - by Floriian - 02.04.2016, 16:34

Forum Jump:


Users browsing this thread: 1 Guest(s)