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:
richard 2009-11-28 22:32:44 +01:00
parent 96b285d7ac
commit 109a923ae3
5 changed files with 122 additions and 26 deletions

View File

@ -160,6 +160,10 @@ zr_classes_menu_spawn "0"
// Default: "0"
zr_classes_menu_join "0"
// Automatically close class selection menu after selecting a class.
// Default: "1"
zr_classes_menu_autoclose "1"
// Player is assigned a random class every spawn. [Override: zr_classes_default_*]
// Default: "0"
zr_classes_random "0"
@ -204,12 +208,6 @@ zr_classes_human_select "1"
// Default: "1"
zr_classes_admin_select "1"
// Menu
// Automatically close class selection menu.
// Default: "0"
zr_classes_menu_autoclose "0"
// Overlay
// Allow players to toggle class overlay.
@ -221,8 +219,8 @@ zr_classes_overlay_toggle "1"
zr_classes_overlay_togglecmds "nightvision"
// Default class overlay toggle state set on connecting player.
// Default: "0"
zr_classes_overlay_default "0"
// Default: "1"
zr_classes_overlay_default "1"
// ----------------------------------------------------------------------------

View File

@ -16,7 +16,7 @@
<p class="headerinfo">Targets plugin version 3.0.0 Beta 2, (not released)<br />
Written by Richard Helgeby</p>
<p class="headerinfo">Manual last modified: 2009.11.22</p>
<p class="headerinfo">Manual last modified: 2009.11.28</p>
<h2>Index</h2>
@ -4384,7 +4384,7 @@ back to a default action.</p>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">fatal</td>
<td class="commandheader">Missing models file: &lt;file&gt;</td>
<td class="commandheader">Missing model list: &lt;file&gt;</td>
</tr>
<tr>
<td class="indent" colspan="3">
@ -4395,37 +4395,119 @@ back to a default action.</p>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">error</td>
<td class="commandheader">Error opening model path directory: &lt;directory&gt;</td>
<td class="commandheader">fatal</td>
<td class="commandheader">Can't find any models in&lt;file&gt;</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> The model path doesn't exist. Check for typos. Path
is relative to the <code>cstrike</code> folder.</p>
<p><strong>Description:</strong> The model file is empty or corrupt. Check for missing
quotes, etc.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">warning</td>
<td class="commandheader">Warning: Maximum number of models reached (&lt;max models&gt;).
Skipping other models.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> There's too many models in the model list, and the
rest of the list is ignored.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">warning</td>
<td class="commandheader">Warning: Invalid model name/path setting at index &lt;index&gt;.
File not found: &lt;model file&gt;.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> The specified model file could not be found, verify
<code>path</code> and <code>name</code> attributes. Path must end with "/".</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">warning</td>
<td class="commandheader">Warning: Invalid model team setting at index &lt;index&gt;:
&lt;attribute value&gt;.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> Model <code>team</code> attribute failed validation.
Check for typos and that it has a valid value.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">warning</td>
<td class="commandheader">Warning: Invalid model access setting at index &lt;index&gt;:
&lt;attribute value&gt;.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> Model <code>access</code> attribute failed validation.
Check for typos and that it has a valid value.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">warning</td>
<td class="commandheader">Warning: Invalid model group setting at index &lt;index&gt;.
Couldn't find SourceMod group &lt;group name&gt;.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> The specified group name does not exist in the
<a href="http://wiki.alliedmods.net/Adding_Groups_(SourceMod)">SourceMod group list</a>.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">error</td>
<td class="commandheader">Missing model files on server (&lt;file&gt;)</td>
<td class="commandheader">Error opening directory: &lt;directory&gt;</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> The model file doesn't exist. Check for typos. Path
is relative to the <code>cstrike</code> folder.</p>
<p><strong>Description:</strong> Couldn't open the directory specified in
<code>path</code> attribute. Verify that the game server has read access, and access to
list files in that directory.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">error</td>
<td class="commandheader">Couldn't find any model files for &lt;model name&gt;. Check
<code>name</code> and <code>path</code>.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> Files starting with the model name could not be found
in the specified path. Verify that the <code>name</code> attribute only contains the
model name, and not the path.</p>
</td>
</tr>
<tr>
<td class="commandheader">models</td>
<td class="commandheader">fatal</td>
<td class="commandheader">No usable (public) model paths in &lt;file&gt;</td>
<td class="commandheader">Missing public model in &lt;model list file&gt;. There must be at
least one public model.</td>
</tr>
<tr>
<td class="indent" colspan="3">
<p><strong>Description:</strong> There's no public models to be assigned zombies and humans.</p>
<p><strong>Cause:</strong> Typos or invalid paths in model list.</p>
<p><strong>Description:</strong> There's no public models to be assigned either/both
zombies and humans. Verify that <code>access</code> attribute is "public" on at least
one model per team.</p>
</td>
</tr>

View File

@ -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.");
// ===========================

View File

@ -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.

View File

@ -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))