added new cooldown system that tracks minutes played into database rows and sets maps on cooldown until they fallen down enough of the listing

This commit is contained in:
jenz
2026-04-19 15:26:58 +02:00
parent 01816792ae
commit f590dcc7d1
4 changed files with 312 additions and 37 deletions
@@ -529,6 +529,13 @@ public Action Command_Nominate(int client, int args)
return Plugin_Handled;
}
//yeah admins and leaders cant bypass these restrictions, maybe the admins really are the problem sometimes for skipping restrictions.
int Index_Cooldown = GetExcludedMapListingPriority(mapname);
if (Index_Cooldown > 0)
{
CPrintToChat(client, "[NE] Map is on Cooldown for being overplayed. List Posistion: %i", Index_Cooldown);
return Plugin_Handled;
}
//July 2024 edit: any person who is potential leader can just skip all cooldowns and map restrictions. same for admins.
if(!CheckCommandAccess(client, "sm_nominate_ignore", ADMFLAG_KICK, true) && !Leader_Is(client))
@@ -942,6 +949,7 @@ Menu BuildMapMenu(const char[] filter, int client)
{
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() ||
GetExcludedMapListingPriority(map) > 0 ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetAveragePlayerTimeOnServerMapRestriction(map) > 0 ||
@@ -1034,6 +1042,12 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
}
GetClientName(param1, name, MAX_NAME_LENGTH);
int Index_Cooldown = GetExcludedMapListingPriority(map);
if (Index_Cooldown > 0)
{
PrintToChat(param1, "[NE] You cant nominate this map right now. Overplayed Position: %i", Index_Cooldown);
return 0;
}
if (!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_KICK, true) && !Leader_Is(param1))
{
@@ -1132,6 +1146,11 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
delete MapList;
delete OwnerList;
int Index_Cooldown = GetExcludedMapListingPriority(map);
if (Index_Cooldown > 0)
{
return ITEMDRAW_DISABLED;
}
if(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_KICK, true) && !Leader_Is(param1))
{
if(AreRestrictionsActive() && (
@@ -1187,6 +1206,13 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
Format(buffer, sizeof(buffer), "%s (%T)", buffer, "VIP Restriction", param1);
}
int Index_Cooldown = GetExcludedMapListingPriority(map);
if (Index_Cooldown > 0)
{
Format(display, sizeof(display), "%s (Overplayed pos: %i)", map, Index_Cooldown);
return RedrawMenuItem(display);
}
int Cooldown = GetMapCooldownTime(map);
if(RestrictionsActive && Cooldown > GetTime())
{
@@ -1296,6 +1322,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
{
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() || //this one is fine cause its admin nomination.
GetExcludedMapListingPriority(map) > 0 ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetAveragePlayerTimeOnServerMapRestriction(map) > 0 ||