20.06.2018, 16:57
Quote:
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.
|
Forexample, if the module file's name is WeaponShop
PHP Code:
forward WS_OnGameModeInit();
public WS_OnGameModeInit()
{
//code
}
PHP Code:
public OnGameModeInit()
{
WS_OnGameModeInit();
}
@OP, don't put your module files in includes folder, put them in a child directory in gamemodes folder.