added so maps are greyed out for admins and leaders too in case of cooldowns

This commit is contained in:
jenz 2024-10-12 00:47:07 +02:00
parent c012ab6581
commit 65932af8db

View File

@ -399,6 +399,14 @@ public Action Command_Addmap(int client, int args)
AttemptAdminNominate(client, mapname);
return Plugin_Handled;
}
int Cooldown1 = GetMapCooldownTime(mapname);
if(Cooldown1 > GetTime())
{
int Seconds = Cooldown1 - GetTime();
CPrintToChat(client, "[NE] %t", "Map Cooldown Time Error", Seconds / 3600, (Seconds % 3600) / 60);
return Plugin_Handled;
}
if(!CheckCommandAccess(client, "sm_nominate_ignore", ADMFLAG_KICK, true) )
{
@ -425,14 +433,6 @@ public Action Command_Addmap(int client, int args)
}
}
int Cooldown = GetMapCooldownTime(mapname);
if(Cooldown > GetTime())
{
int Seconds = Cooldown - GetTime();
CPrintToChat(client, "[NE] %t", "Map Cooldown Time Error", Seconds / 3600, (Seconds % 3600) / 60);
return Plugin_Handled;
}
int TimeRestriction = GetMapTimeRestriction(mapname);
if(RestrictionsActive && TimeRestriction)
@ -678,6 +678,15 @@ public Action Command_Nominate(int client, int args)
return Plugin_Handled;
}
int Cooldown1 = GetMapCooldownTime(mapname);
if(Cooldown1 > GetTime())
{
int Seconds = Cooldown1 - GetTime();
CPrintToChat(client, "[NE] %t", "Map Cooldown Time Error", Seconds / 3600, (Seconds % 3600) / 60);
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))
{
@ -701,14 +710,6 @@ public Action Command_Nominate(int client, int args)
return Plugin_Handled;
}
int Cooldown = GetMapCooldownTime(mapname);
if(Cooldown > GetTime())
{
int Seconds = Cooldown - GetTime();
CPrintToChat(client, "[NE] %t", "Map Cooldown Time Error", Seconds / 3600, (Seconds % 3600) / 60);
return Plugin_Handled;
}
bool VIPRestriction = GetMapVIPRestriction(mapname, client);
if(RestrictionsActive && VIPRestriction)
@ -1159,10 +1160,15 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
GetClientName(param1, name, MAX_NAME_LENGTH);
if (GetMapCooldownTime(map) > GetTime())
{
PrintToChat(param1, "[NE] You cant nominate this map right now.");
return 0;
}
if(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_KICK, true) && !Leader_Is(param1))
{
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetAveragePlayerTimeOnServerMapRestriction(map) > 0 ||
@ -1241,10 +1247,13 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
}
}
if (GetMapCooldownTime(map) > GetTime())
{
return ITEMDRAW_DISABLED;
}
if(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_KICK, true) && !Leader_Is(param1))
{
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetAveragePlayerTimeOnServerMapRestriction(map) > 0 ||