Made cvar for displaying class menu on first spawn. Renamed class menu cvars.

This commit is contained in:
richard
2009-11-20 18:20:45 +01:00
parent 709b5d3bab
commit bedb4d4bda
4 changed files with 22 additions and 6 deletions

View File

@ -75,6 +75,9 @@ ClassClientInit(client)
// Forward event to sub-modules.
ClassOverlayClientInit(client);
}
// Reset spawn flag.
ClassPlayerSpawned[client] = false;
}
/**
@ -176,10 +179,12 @@ ClassOnClientSpawn(client)
TranslationPrintToChat(client, "Classes random assignment", classname);
}
// Display class menu if enabled.
new bool:classmenu = GetConVarBool(g_hCvarsList[CVAR_CLASSES_SPAWN]);
if (classmenu)
// Display class menu if either menu cvar is set.
new bool:menuspawn = GetConVarBool(g_hCvarsList[CVAR_CLASSES_MENU_SPAWN]);
new bool:menujoin = GetConVarBool(g_hCvarsList[CVAR_CLASSES_MENU_JOIN]);
if (menuspawn || (menujoin && !ClassPlayerSpawned[client]))
{
ClassPlayerSpawned[client] = true;
ClassMenuMain(client);
}
}

View File

@ -458,6 +458,11 @@ new bool:ClassAllowInstantChange[MAXPLAYERS + 1];
*/
new String:ClassOriginalPlayerModel[MAXPLAYERS + 1][PLATFORM_MAX_PATH];
/**
* Specifies whether a player has spawned.
*/
new bool:ClassPlayerSpawned[MAXPLAYERS + 1];
#include "zr/playerclasses/filtertools"
#include "zr/playerclasses/attributes"
#include "zr/playerclasses/apply"