How to divide gamemode in INCLUDES?
#4

Quote:
Originally Posted by ******
View Post
5) Don't use monolithic callbacks. Use libraries like y_commands and y_dialogs to avoid having to put everything under `OnPlayerCommandText` and the like. This is yet another way of ensuing that all related code appears in a single file. As a good rule-of-thumb files should be no more than 1000 lines long, and functions 100 lines. As verc said, for other callbacks you can split them up with y_hooks.
I didn't use y_hooks or any other hook method and my code ended up like this:
Forexample, if the module file's name is WeaponShop
PHP Code:
forward WS_OnGameModeInit();
public 
WS_OnGameModeInit()
{
    
//code

And then in the main game mode file
PHP Code:
public OnGameModeInit()
{
    
WS_OnGameModeInit();

Is this a bad idea??

@OP, don't put your module files in includes folder, put them in a child directory in gamemodes folder.
Reply


Messages In This Thread
How to divide gamemode in INCLUDES? - by div - 20.06.2018, 14:28
Re: How to divide gamemode in INCLUDES? - by taktaz - 20.06.2018, 14:44
Re: How to divide gamemode in INCLUDES? - by Verc - 20.06.2018, 15:34
Re: How to divide gamemode in INCLUDES? - by coool - 20.06.2018, 16:57
Re: How to divide gamemode in INCLUDES? - by div - 20.06.2018, 17:02
Re: How to divide gamemode in INCLUDES? - by Hunud - 20.06.2018, 17:04
Re: How to divide gamemode in INCLUDES? - by Garr - 20.06.2018, 17:29
Re: How to divide gamemode in INCLUDES? - by div - 20.06.2018, 17:36
Re: How to divide gamemode in INCLUDES? - by div - 20.06.2018, 17:43
Re: How to divide gamemode in INCLUDES? - by div - 20.06.2018, 18:00

Forum Jump:


Users browsing this thread: 1 Guest(s)