moved from chat to menu

This commit is contained in:
jenz 2026-06-17 13:28:16 +02:00
parent f9eed6291d
commit 927d55e64d

View File

@ -153,6 +153,7 @@ public void OnPluginStart()
} }
RegConsoleCmd("sm_playtime", Command_Time, "retreives total connection time on all connected servers"); RegConsoleCmd("sm_playtime", Command_Time, "retreives total connection time on all connected servers");
RegConsoleCmd("sm_tier", Command_Tier, "shows what tier features you have"); RegConsoleCmd("sm_tier", Command_Tier, "shows what tier features you have");
RegConsoleCmd("sm_tiers", Command_Tier, "shows what tier features you have");
RegConsoleCmd("sm_topplaytime", Command_TopTime, "retreives top 1000 playtime highscores on all connected servers"); RegConsoleCmd("sm_topplaytime", Command_TopTime, "retreives top 1000 playtime highscores on all connected servers");
g_h_time_activity = CreateTimer(10.0, time_query_activity, INVALID_HANDLE, TIMER_REPEAT); g_h_time_activity = CreateTimer(10.0, time_query_activity, INVALID_HANDLE, TIMER_REPEAT);
@ -804,16 +805,17 @@ public Action Command_TopTime(int client, int args)
public void PrintClientGroupOverrides(int client) public void PrintClientGroupOverrides(int client)
{ {
AdminId id = GetUserAdmin(client); AdminId id = GetUserAdmin(client);
if (id == INVALID_ADMIN_ID)
{
PrintToChat(client, "You have no tiers.");
return;
}
int groupCount = GetAdminGroupCount(id); char sTitle[64];
if (groupCount == 0) Format(sTitle, sizeof(sTitle), "Tier %i Rewards", g_iPlayerTier[client]);
Menu menu = new Menu(MenuHandler1);
menu.SetTitle(sTitle);
if (id == INVALID_ADMIN_ID || GetAdminGroupCount(id) == 0)
{ {
PrintToChat(client, "You have no tiers."); menu.AddItem("-1", "You have no tiers.", ITEMDRAW_DISABLED);
menu.ExitButton = true;
menu.Display(client, 0);
return; return;
} }
@ -823,6 +825,7 @@ public void PrintClientGroupOverrides(int client)
char spray_tier[32]; char spray_tier[32];
Format(spray_tier, sizeof(spray_tier), "tier%i", FindConVar("sm_spraymanager_tier_required").IntValue); Format(spray_tier, sizeof(spray_tier), "tier%i", FindConVar("sm_spraymanager_tier_required").IntValue);
int groupCount = GetAdminGroupCount(id);
for (int i = 0; i < groupCount; i++) for (int i = 0; i < groupCount; i++)
{ {
char groupName[64]; char groupName[64];
@ -831,21 +834,29 @@ public void PrintClientGroupOverrides(int client)
if (grp == INVALID_GROUP_ID) if (grp == INVALID_GROUP_ID)
continue; continue;
char overrides[512]; char entry[128];
if (StrEqual(groupName, rtv_boost_tier)) if (StrEqual(groupName, rtv_boost_tier))
{ {
PrintToChat(client, "tier%i access: %i mapvote/rtv/nomination boost", g_iRtvBoost_tier, g_iPlayerRTVCapacity); Format(entry, sizeof(entry), "tier%i: %ix mapvote/rtv/nomination boost", g_iRtvBoost_tier, g_iPlayerRTVCapacity);
menu.AddItem("-1", entry, ITEMDRAW_DISABLED);
} }
if (StrEqual(groupName, spray_tier)) if (StrEqual(groupName, spray_tier))
{ {
PrintToChat(client, "%s access: sprays",spray_tier ); Format(entry, sizeof(entry), "%s: sprays", spray_tier);
menu.AddItem("-1", entry, ITEMDRAW_DISABLED);
} }
char overrides[512];
if (g_GroupOverrides.GetString(groupName, overrides, sizeof(overrides))) if (g_GroupOverrides.GetString(groupName, overrides, sizeof(overrides)))
{ {
PrintToChat(client, "%s access: %s", groupName, overrides); Format(entry, sizeof(entry), "%s: %s", groupName, overrides);
menu.AddItem("-1", entry, ITEMDRAW_DISABLED);
} }
} }
PrintToChat(client, "any tier access: playermodels in zclass.");
menu.AddItem("-1", "any tier: playermodels in zclass.", ITEMDRAW_DISABLED);
menu.ExitButton = true;
menu.Display(client, 0);
} }
public Action Command_Tier(int client, int args) public Action Command_Tier(int client, int args)