forked from UNLOZE/sm-plugins
renamed variable for skipping all restrictions on low pop and now also made it skip cooldowns as well as adding a new variable that decides how many players are required before applying cooldowns at all. also changed player counting not consider fakes, autism bots, afks and spec anymore to make it a lot simpler to understand.
This commit is contained in:
@@ -327,47 +327,6 @@ 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) )
|
||||
{
|
||||
bool RestrictionsActive = AreRestrictionsActive();
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(mapname);
|
||||
if(RestrictionsActive && TimeRestriction)
|
||||
{
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate Time Error", TimeRestriction / 60, TimeRestriction % 60);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int AverageHourRestricted = GetAveragePlayerTimeOnServerMapRestriction(mapname);
|
||||
if (RestrictionsActive && AverageHourRestricted > 0)
|
||||
{
|
||||
PrintToChat(client, "%s requires +%i hours average. Use sm_houravg to check average.", mapname, AverageHourRestricted);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int PlayerRestriction = GetMapPlayerRestriction(mapname);
|
||||
if(RestrictionsActive && PlayerRestriction)
|
||||
{
|
||||
if(PlayerRestriction < 0)
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MinPlayers Error", PlayerRestriction * -1);
|
||||
else
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MaxPlayers Error", PlayerRestriction);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
NominateResult result = NominateMap(mapname, true, 0);
|
||||
|
||||
@@ -570,19 +529,22 @@ 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))
|
||||
{
|
||||
bool RestrictionsActive = AreRestrictionsActive();
|
||||
|
||||
//restrictions not being active now also skips all the cooldowns.
|
||||
int Cooldown1 = GetMapCooldownTime(mapname);
|
||||
if(RestrictionsActive && Cooldown1 > GetTime())
|
||||
{
|
||||
int Seconds = Cooldown1 - 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)
|
||||
{
|
||||
@@ -973,11 +935,8 @@ Menu BuildMapMenu(const char[] filter, int client)
|
||||
}
|
||||
if (g_bClientsIgnoring[client])
|
||||
{
|
||||
if (GetMapCooldownTime(map) > GetTime())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(AreRestrictionsActive() && (
|
||||
GetMapCooldownTime(map) > GetTime() ||
|
||||
GetMapTimeRestriction(map) ||
|
||||
GetMapPlayerRestriction(map) ||
|
||||
GetAveragePlayerTimeOnServerMapRestriction(map) > 0 ||
|
||||
@@ -1071,15 +1030,10 @@ 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 ||
|
||||
@@ -1172,14 +1126,11 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
delete MapList;
|
||||
delete OwnerList;
|
||||
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 ||
|
||||
@@ -1232,7 +1183,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
|
||||
int Cooldown = GetMapCooldownTime(map);
|
||||
if(Cooldown > GetTime())
|
||||
if(RestrictionsActive && Cooldown > GetTime())
|
||||
{
|
||||
int Seconds = Cooldown - GetTime();
|
||||
char time[16];
|
||||
|
||||
Reference in New Issue
Block a user