diff --git a/mapchooser_extended/scripting/mapchooser_extended.sp b/mapchooser_extended/scripting/mapchooser_extended.sp index 4e57c0f0..26577c96 100644 --- a/mapchooser_extended/scripting/mapchooser_extended.sp +++ b/mapchooser_extended/scripting/mapchooser_extended.sp @@ -237,7 +237,7 @@ public void OnPluginStart() g_Cvar_ExtendTimeStep = CreateConVar("mce_extend_timestep", "15", "Specifies how much many more minutes each extension makes", _, true, 5.0); g_Cvar_ExtendRoundStep = CreateConVar("mce_extend_roundstep", "5", "Specifies how many more rounds each extension makes", _, true, 1.0); g_Cvar_ExtendFragStep = CreateConVar("mce_extend_fragstep", "10", "Specifies how many more frags are allowed when map is extended.", _, true, 5.0); - g_Cvar_ExcludeMaps = CreateConVar("mce_exclude", "5", "Specifies for how many hours past maps should be excluded from the vote.", _, true, 0.0); + g_Cvar_ExcludeMaps = CreateConVar("mce_exclude", "5", "Specifies how many past maps to exclude from the vote.", _, true, 0.0); g_Cvar_IncludeMaps = CreateConVar("mce_include", "5", "Specifies how many maps to include in the vote.", _, true, 2.0, true, 7.0); g_Cvar_IncludeMapsReserved = CreateConVar("mce_include_reserved", "2", "Specifies how many private/random maps to include in the vote.", _, true, 0.0, true, 5.0); g_Cvar_NoVoteMode = CreateConVar("mce_novote", "1", "Specifies whether or not MapChooser should pick a map if no votes are received.", _, true, 0.0, true, 1.0); @@ -378,8 +378,6 @@ public void OnPluginStart() g_MapVoteRunoffStartForward = CreateGlobalForward("OnMapVoteRunnoffWarningStart", ET_Ignore); InternalRestoreMapCooldowns(); - - CreateTimer(60.0, UpdateCooldowns, INVALID_HANDLE, TIMER_REPEAT); } public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) @@ -528,28 +526,23 @@ public void OnMapEnd() g_WarningTimer = INVALID_HANDLE; g_RunoffCount = 0; - if(g_SaveCDOnMapEnd) - { - static char map[PLATFORM_MAX_PATH]; - GetCurrentMap(map, PLATFORM_MAX_PATH); - int Cooldown = InternalGetMapCooldown(map); - g_OldMapList.SetValue(map, Cooldown, true); - InternalStoreMapCooldowns(); - } -} - -public Action UpdateCooldowns(Handle timer) -{ static char map[PLATFORM_MAX_PATH]; int Cooldown; + if(g_SaveCDOnMapEnd) + { + GetCurrentMap(map, PLATFORM_MAX_PATH); + Cooldown = InternalGetMapCooldown(map); + g_OldMapList.SetValue(map, Cooldown, true); + } + StringMapSnapshot OldMapListSnapshot = g_OldMapList.Snapshot(); for(int i = 0; i < OldMapListSnapshot.Length; i++) { OldMapListSnapshot.GetKey(i, map, sizeof(map)); g_OldMapList.GetValue(map, Cooldown); - Cooldown --; + Cooldown--; if(Cooldown > 0) g_OldMapList.SetValue(map, Cooldown, true); else @@ -2308,7 +2301,7 @@ stock int InternalGetMapCooldown(const char[] map) g_Config.Rewind(); } - return RoundToNearest(Cooldown * 60.0); + return Cooldown; } void CheckMapRestrictions(bool time = false, bool players = false) diff --git a/mapchooser_extended/scripting/nominations_extended.sp b/mapchooser_extended/scripting/nominations_extended.sp index 933d9874..b6d039a5 100644 --- a/mapchooser_extended/scripting/nominations_extended.sp +++ b/mapchooser_extended/scripting/nominations_extended.sp @@ -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 [cooldown (minutes)] [mode]"); + CReplyToCommand(client, "[NE] Usage: sm_nominate_exclude "); 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); -} diff --git a/mapchooser_extended/translations/mapchooser_extended.phrases.txt b/mapchooser_extended/translations/mapchooser_extended.phrases.txt index e252fd61..07ad85a4 100644 --- a/mapchooser_extended/translations/mapchooser_extended.phrases.txt +++ b/mapchooser_extended/translations/mapchooser_extended.phrases.txt @@ -111,15 +111,9 @@ "en" "VIP Nomination" } - "Map Nominate Cooldown Error" - { - "#format" "{1:d},{2:d}" - "en" "You need to wait {1} hours and {2} minutes for the map to come off cooldown." - } - "Map Nominate VIP Error" { - "en" "You need to be VIP to nominate this map." + "en" "Only VIPs can nominate this map." } "Map Nominate Time Error" @@ -146,12 +140,6 @@ "en" "The maximum amount ({1}) of maps from this group has already been nominated." } - "Map Cooldown" - { - "#format" "{1:d},{2:d}" - "en" "Cooldown: {1}H{2}M" - } - "Map Time Restriction" { "#format" "{1:s},{2:d},{3:d}"