forked from UNLOZE/sm-plugins
Revert "MCE: replace map-based CD system with time-based one"
This reverts commit 217f1680e0.
This commit is contained in:
@@ -118,8 +118,6 @@ public void OnPluginStart()
|
||||
CreateConVar("ne_version", MCE_VERSION, "Nominations Extended Version", FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
|
||||
|
||||
g_mapTrie = CreateTrie();
|
||||
|
||||
CreateTimer(60.0, ForceUpdate, INVALID_HANDLE, TIMER_REPEAT);
|
||||
}
|
||||
|
||||
public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] err, int iErrLen)
|
||||
@@ -241,11 +239,6 @@ void UpdateMapTrie()
|
||||
delete excludeMaps;
|
||||
}
|
||||
|
||||
public Action ForceUpdate(Handle timer)
|
||||
{
|
||||
UpdateMapTrie();
|
||||
}
|
||||
|
||||
public void OnNominationRemoved(const char[] map, int owner)
|
||||
{
|
||||
int status;
|
||||
@@ -298,9 +291,7 @@ public Action Command_Addmap(int client, int args)
|
||||
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
||||
{
|
||||
int Cooldown = GetMapCooldown(mapname);
|
||||
int ConvertedCooldown[2];
|
||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
||||
CPrintToChat(client, "[NE] %T", "Map Nominate Cooldown Error", client, ConvertedCooldown[0], ConvertedCooldown[1]);
|
||||
CPrintToChat(client, "[NE] %t (%d)", "Map in Exclude List", Cooldown);
|
||||
}
|
||||
|
||||
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
||||
@@ -394,7 +385,7 @@ public Action Command_AddExclude(int client, int args)
|
||||
{
|
||||
if(args < 1)
|
||||
{
|
||||
CReplyToCommand(client, "[NE] Usage: sm_nominate_exclude <mapname> [cooldown (minutes)] [mode]");
|
||||
CReplyToCommand(client, "[NE] Usage: sm_nominate_exclude <mapname>");
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
@@ -510,9 +501,7 @@ public Action Command_Nominate(int client, int args)
|
||||
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
||||
{
|
||||
int Cooldown = GetMapCooldown(mapname);
|
||||
int ConvertedCooldown[2];
|
||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
||||
CPrintToChat(client, "[NE] %T", "Map Nominate Cooldown Error", client, ConvertedCooldown[0], ConvertedCooldown[1]);
|
||||
CPrintToChat(client, "[NE] %t (%d)", "Map in Exclude List", Cooldown);
|
||||
}
|
||||
|
||||
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
||||
@@ -885,9 +874,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
if(((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) && AreRestrictionsActive())
|
||||
{
|
||||
int Cooldown = GetMapCooldown(map);
|
||||
int ConvertedCooldown[2];
|
||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Cooldown", param1, ConvertedCooldown[0], ConvertedCooldown[1]);
|
||||
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
@@ -1063,9 +1050,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
||||
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
||||
{
|
||||
int Cooldown = GetMapCooldown(map);
|
||||
int ConvertedCooldown[2];
|
||||
ConvertCooldown(Cooldown, ConvertedCooldown);
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Cooldown", param1, ConvertedCooldown[0], ConvertedCooldown[1]);
|
||||
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
@@ -1229,9 +1214,3 @@ stock int GetVIPTimeRestriction()
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
stock void ConvertCooldown(int Cooldown, int Time[2])
|
||||
{
|
||||
Time[0] = Cooldown / 60;
|
||||
Time[1] = Cooldown - (Time[0] * 60);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user