Made config module, recoded models.inc and added validations, added a cvar to flag any sayhook as quiet to hide from chat, hooked mp_limitteams, fixed menu handle function, moved file paths into cvars and updated all modules but classes to use it

This commit is contained in:
Greyscale
2009-04-30 07:36:57 +02:00
parent 1a638cfbac
commit 8da309e4f4
15 changed files with 466 additions and 191 deletions

View File

@ -82,20 +82,25 @@ WeaponsLoad()
return;
}
decl String:path[PLATFORM_MAX_PATH];
BuildPath(Path_SM, path, sizeof(path), "configs/zr/weapons/weapons.txt");
// Get weapons config path.
decl String:pathweapons[PLATFORM_MAX_PATH];
new bool:exists = ConfigGetFilePath(CVAR_CONFIG_PATH_WEAPONS, pathweapons);
// If file isn't found, stop plugin.
if (!FileToKeyValues(kvWeapons, path))
// If file doesn't exist, then log and stop.
if (!exists)
{
// Log failure.
if (LogCheckFlag(LOG_CORE_EVENTS, LOG_MODULE_WEAPONS))
{
LogMessageFormatted(-1, "Weapons", "Config Validation", "Missing file weapons.txt.", LOG_FORMAT_TYPE_ERROR);
LogMessageFormatted(-1, "Weapons", "Config Validation", "Missing weapons config file: %s", LOG_FORMAT_TYPE_ERROR, pathweapons);
}
return;
}
// Put file data into memory.
FileToKeyValues(kvWeapons, pathweapons);
// Validate weapons config.
WeaponsValidateConfig();