added missing phrase file and hopefully fixed errors thrown by mapchooser

This commit is contained in:
jenz
2023-03-23 19:47:48 +01:00
parent 709a07a62b
commit 5840846119
3 changed files with 158 additions and 72 deletions
@@ -696,15 +696,15 @@ void AttemptNominate(int client, const char[] filter = "")
void AttemptAdminNominate(int client, const char[] filter = "")
{
if(!client)
return;
if(!client)
return;
Menu menu = g_AdminMapMenu;
if(filter[0])
menu = BuildAdminMapMenu(filter);
Menu menu = g_AdminMapMenu;
if(filter[0])
menu = BuildAdminMapMenu(filter);
SetMenuTitle(menu, "%T", "Nominate Title", client);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
SetMenuTitle(menu, "%T", "Nominate Title", client);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
void AttemptAdminRemoveMap(int client, const char[] filter = "")
@@ -932,58 +932,62 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
}
case MenuAction_Select:
{
if(g_Player_NominationDelay[param1] > GetTime())
//2023-03-22 edit since client sometimes is 0 which fucks up mapchooser
if (param1 > 0 && param1 <= MaxClients && IsClientConnected(param1) && IsClientInGame(param1))
{
PrintToChat(param1, "[NE] Please wait %d seconds before you can nominate again", g_Player_NominationDelay[param1] - GetTime());
DisplayMenuAtItem(menu, param1, GetMenuSelectionPosition(), MENU_TIME_FOREVER);
return 0;
if(g_Player_NominationDelay[param1] > GetTime())
{
PrintToChat(param1, "[NE] Please wait %d seconds before you can nominate again", g_Player_NominationDelay[param1] - GetTime());
DisplayMenuAtItem(menu, param1, GetMenuSelectionPosition(), MENU_TIME_FOREVER);
return 0;
}
static char map[PLATFORM_MAX_PATH];
char name[MAX_NAME_LENGTH];
GetMenuItem(menu, param2, map, sizeof(map));
GetClientName(param1, name, MAX_NAME_LENGTH);
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetMapVIPRestriction(map, param1)))
{
PrintToChat(param1, "[NE] You cant nominate this map right now.");
return 0;
}
NominateResult result = NominateMap(map, false, param1);
if (result == Nominate_InvalidMap)
{
PrintToChat(param1, "[NE] You already nominated the map %s", map);
return 0;
}
/* Dont need to check for InvalidMap because the menu did that already */
if(result == Nominate_AlreadyInVote)
{
PrintToChat(param1, "[NE] %t", "Map Already Nominated");
return 0;
}
else if(result == Nominate_VoteFull)
{
PrintToChat(param1, "[NE] %t", "Max Nominations");
return 0;
}
//SetTrieValue(g_mapTrie, map, MAPSTATUS_DISABLED|MAPSTATUS_EXCLUDE_NOMINATED);
if(result == Nominate_Added)
PrintToChatAll("[NE] %t", "Map Nominated", name, map);
else if(result == Nominate_Replaced)
PrintToChatAll("[NE] %t", "Map Nomination Changed", name, map);
LogMessage("%s nominated %s", name, map);
g_Player_NominationDelay[param1] = GetTime() + GetConVarInt(g_Cvar_NominateDelay);
}
static char map[PLATFORM_MAX_PATH];
char name[MAX_NAME_LENGTH];
GetMenuItem(menu, param2, map, sizeof(map));
GetClientName(param1, name, MAX_NAME_LENGTH);
if(AreRestrictionsActive() && (
GetMapCooldownTime(map) > GetTime() ||
GetMapTimeRestriction(map) ||
GetMapPlayerRestriction(map) ||
GetMapVIPRestriction(map, param1)))
{
PrintToChat(param1, "[NE] You cant nominate this map right now.");
return 0;
}
NominateResult result = NominateMap(map, false, param1);
if (result == Nominate_InvalidMap)
{
PrintToChat(param1, "[NE] You already nominated the map %s", map);
return 0;
}
/* Dont need to check for InvalidMap because the menu did that already */
if(result == Nominate_AlreadyInVote)
{
PrintToChat(param1, "[NE] %t", "Map Already Nominated");
return 0;
}
else if(result == Nominate_VoteFull)
{
PrintToChat(param1, "[NE] %t", "Max Nominations");
return 0;
}
//SetTrieValue(g_mapTrie, map, MAPSTATUS_DISABLED|MAPSTATUS_EXCLUDE_NOMINATED);
if(result == Nominate_Added)
PrintToChatAll("[NE] %t", "Map Nominated", name, map);
else if(result == Nominate_Replaced)
PrintToChatAll("[NE] %t", "Map Nomination Changed", name, map);
LogMessage("%s nominated %s", name, map);
g_Player_NominationDelay[param1] = GetTime() + GetConVarInt(g_Cvar_NominateDelay);
}
case MenuAction_DrawItem: