Updated docs with new model error messages. Minior fixes.
Improved error handling of model list. Fixed typo in class attribute validator. Changed cvar defaults: class menu auto-close and overlay default state.
This commit is contained in:
@ -271,12 +271,12 @@ CvarsCreate()
|
||||
g_hCvarsList[CVAR_CLASSES_ADMIN_SELECT] = CreateConVar("zr_classes_admin_select", "1", "Allow admins to select admin mode classes. (Not to be confused by admin-only classes!)");
|
||||
|
||||
// Menu
|
||||
g_hCvarsList[CVAR_CLASSES_MENU_AUTOCLOSE] = CreateConVar("zr_classes_menu_autoclose", "0", "Automatically close class selection menu after selecting a class.");
|
||||
g_hCvarsList[CVAR_CLASSES_MENU_AUTOCLOSE] = CreateConVar("zr_classes_menu_autoclose", "1", "Automatically close class selection menu after selecting a class.");
|
||||
|
||||
// Overlays
|
||||
g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLE] = CreateConVar("zr_classes_overlay_toggle", "1", "Allow players to toggle class overlay.");
|
||||
g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLECMDS] = CreateConVar("zr_classes_overlay_togglecmds", "nightvision", "List of commands to hook that players can use to toggle class overlay. [Dependency: zr_classes_overlay_toggle | Delimiter: \", \"]");
|
||||
g_hCvarsList[CVAR_CLASSES_OVERLAY_DEFAULT] = CreateConVar("zr_classes_overlay_default", "0", "Default class overlay toggle state set on connecting player.");
|
||||
g_hCvarsList[CVAR_CLASSES_OVERLAY_DEFAULT] = CreateConVar("zr_classes_overlay_default", "1", "Default class overlay toggle state set on connecting player.");
|
||||
|
||||
|
||||
// ===========================
|
||||
|
@ -90,6 +90,7 @@ ModelsLoad()
|
||||
ModelCount = 0;
|
||||
new failedCount;
|
||||
new publicCount;
|
||||
new downloadCount;
|
||||
|
||||
// Loop through all models and store attributes in ModelData array.
|
||||
do
|
||||
@ -148,7 +149,7 @@ ModelsLoad()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Increment public model counter.
|
||||
// Increment public model counter for the current team.
|
||||
if (ModelData[ModelCount][Model_Access] == ModelAccess_Public)
|
||||
{
|
||||
publicCount++;
|
||||
@ -174,6 +175,9 @@ ModelsLoad()
|
||||
continue;
|
||||
}
|
||||
|
||||
// Reset file counter for the current model.
|
||||
downloadCount = 0;
|
||||
|
||||
new FileType:type;
|
||||
decl String:file[64];
|
||||
decl String:fileShort[64];
|
||||
@ -206,11 +210,23 @@ ModelsLoad()
|
||||
// Precache model file and add to downloads table.
|
||||
PrecacheModel(buffer, true);
|
||||
AddFileToDownloadsTable(buffer);
|
||||
|
||||
// Increment file counter for the current model.
|
||||
downloadCount++;
|
||||
}
|
||||
|
||||
CloseHandle(dir);
|
||||
|
||||
ModelCount++;
|
||||
// Check if no model files were found.
|
||||
if (!downloadCount)
|
||||
{
|
||||
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Models, "Config Validation", "Couldn't find any model files for \"%s\". Check name and path.", name);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Increment model counter.
|
||||
ModelCount++;
|
||||
}
|
||||
} while (KvGotoNextKey(kvModels));
|
||||
|
||||
CloseHandle(kvModels);
|
||||
@ -218,7 +234,7 @@ ModelsLoad()
|
||||
// Check if there are no public models.
|
||||
if (!publicCount)
|
||||
{
|
||||
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Models, "Config Validation", "Couldn't find any public model in \"%s\". There must be at least one public model.", modelPath);
|
||||
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Models, "Config Validation", "Missing public model in \"%s\". There must be at least one public model.", modelPath);
|
||||
}
|
||||
|
||||
// Log model validation info.
|
||||
|
@ -169,7 +169,7 @@ stock ClassValidateAttributes(classindex)
|
||||
!StrEqual(model_path, "random_admins", false) &&
|
||||
!StrEqual(model_path, "random_mother_zombies", false) &&
|
||||
!StrEqual(model_path, "default", false) &&
|
||||
!StrEqual(model_path, "nochange", false))
|
||||
!StrEqual(model_path, "no_change", false))
|
||||
{
|
||||
// Check if the file exists.
|
||||
if (!FileExists(model_path))
|
||||
|
Reference in New Issue
Block a user