From c67b78ac0d70127a43c62c6535f3f46777b0ac9e Mon Sep 17 00:00:00 2001 From: Pawel Date: Sat, 21 Jan 2023 02:34:52 +0100 Subject: [PATCH] Nomination - added multilang in show_lists_menu --- cstrike/addons/amxmodx/data/lang/mapmanager.txt | 2 ++ .../amxmodx/scripting/map_manager_nomination.sma | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cstrike/addons/amxmodx/data/lang/mapmanager.txt b/cstrike/addons/amxmodx/data/lang/mapmanager.txt index ba144e7..7da4283 100644 --- a/cstrike/addons/amxmodx/data/lang/mapmanager.txt +++ b/cstrike/addons/amxmodx/data/lang/mapmanager.txt @@ -47,6 +47,7 @@ MAPM_SECOND_VOTE = Second vote. MAPM_CHANGELEVEL_NEXTROUND = Map will change in next round. MAPM_EARLY_FINISH_VOTE = All players have voted, so we are ending voting^3 early^1. MAPM_FORCE_VOTE_BY_ONLINE = Forced voting to change the map. Current map does not match the current map online. +MAPM_MENU_LIST_TITLE = Maps Lists [pl] MAPM_VOTE_WILL_BEGIN = Glosowanie rozpocznie sie w nastepnej rundzie. @@ -97,6 +98,7 @@ MAPM_SECOND_VOTE = Drugie glosowanie. MAPM_CHANGELEVEL_NEXTROUND = Mapa zostanie zmieniona w nastepnej rundzie. MAPM_EARLY_FINISH_VOTE = Wszyscy gracze oddali juz glosy. Konczymy glosowanie^3 wczesniej^1. MAPM_FORCE_VOTE_BY_ONLINE = Wymuszone głosowanie w sprawie zmiany mapy. Obecna mapa nie zgadza się z aktualną mapą online. +MAPM_MENU_LIST_TITLE = Lista map [ru] MAPM_VOTE_WILL_BEGIN = Голосование начнется в следующем раунде. diff --git a/cstrike/addons/amxmodx/scripting/map_manager_nomination.sma b/cstrike/addons/amxmodx/scripting/map_manager_nomination.sma index b3aa435..5ce6938 100644 --- a/cstrike/addons/amxmodx/scripting/map_manager_nomination.sma +++ b/cstrike/addons/amxmodx/scripting/map_manager_nomination.sma @@ -389,11 +389,13 @@ public clcmd_mapslist(id) show_nomination_menu(id, g_aMapsList); } } + show_lists_menu(id) { new text[64]; - // TODO: add ML - new menu = menu_create("Maps lists:", "lists_handler"); + formatex(text, charsmax(text), "%L", id, "MAPM_MENU_LIST_TITLE"); + + new menu = menu_create(text, "lists_handler"); new list[32], size = mapm_advl_get_active_lists(); for(new i; i < size; i++) { @@ -407,9 +409,10 @@ show_lists_menu(id) menu_setprop(menu, MPROP_NEXTNAME, text); formatex(text, charsmax(text), "%L", id, "MAPM_MENU_EXIT"); menu_setprop(menu, MPROP_EXITNAME, text); - + menu_display(id, menu); } + public lists_handler(id, menu, item) { if(item == MENU_EXIT) { @@ -431,6 +434,7 @@ public lists_handler(id, menu, item) return PLUGIN_HANDLED; } + show_nomination_menu(id, Array:maplist, custom_title[] = "") { new text[64]; @@ -491,6 +495,7 @@ show_nomination_menu(id, Array:maplist, custom_title[] = "") menu_display(id, menu); } + bool:in_array(Array:array, index) { for(new i, size = ArraySize(array); i < size; i++) {