Uploaded manually merged code.

This commit is contained in:
Greyscale
2009-04-29 02:50:25 +02:00
parent 1b8bcc9141
commit f5f9158941
5 changed files with 64 additions and 50 deletions

View File

@@ -68,8 +68,8 @@ ClassMenuMain(client)
Format(humanselect, sizeof(humanselect), "%t\n %s", "!zclass human", humanclass);
AddMenuItem(menu, "", humanselect, human_itemdraw);
// Only display admin class options for admins.
if (ZRIsClientAdmin(client))
// Only display admin class options for admins, and if admin classes exist.
if (ZRIsClientAdmin(client) && ClassCountTeam(ZR_CLASS_TEAM_ADMINS))
{
// List admin class options.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ADMINS], adminclass, sizeof(adminclass), ZR_CLASS_CACHE_MODIFIED);
@@ -243,8 +243,17 @@ public ClassMenuSelectHandle(Handle:menu, MenuAction:action, client, slot)
// Solve teamid from the class index.
teamid = ClassGetTeamID(classindex, ZR_CLASS_CACHE_MODIFIED);
// Set the players active class to the specified class.
ClassSelected[client][teamid] = classindex;
// Check if the class is a admin class.
if (teamid == ZR_CLASS_TEAM_ADMINS)
{
// Set the admin class to be used on next admin spawn.
ClassPlayerNextAdminClass[client] = classindex;
}
else
{
// Set the players active class to the specified class.
ClassSelected[client][teamid] = classindex;
}
}
case MenuAction_Cancel:
{