From d9deb38122bf6e14585c708f7ecd6c944798a502 Mon Sep 17 00:00:00 2001 From: Nord1cWarr1or <47604048+Nord1cWarr1or@users.noreply.github.com> Date: Tue, 11 Jul 2023 20:47:03 +0000 Subject: [PATCH] rtv: add messages if vote already started or finished (#21) --- cstrike/addons/amxmodx/data/lang/mapmanager.txt | 6 ++++++ .../addons/amxmodx/scripting/map_manager_rtv.sma | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cstrike/addons/amxmodx/data/lang/mapmanager.txt b/cstrike/addons/amxmodx/data/lang/mapmanager.txt index c2e5d3d..fc5ccdb 100644 --- a/cstrike/addons/amxmodx/data/lang/mapmanager.txt +++ b/cstrike/addons/amxmodx/data/lang/mapmanager.txt @@ -46,6 +46,8 @@ MAPM_WINS = wins MAPM_VOTE_IN_NEXTROUND = Wait vote in next round. MAPM_SECOND_VOTE = Second vote. MAPM_CHANGELEVEL_NEXTROUND = Map will change in next round. +MAPM_VOTE_ALREADY_STARTED = Voting has already started. +MAPM_VOTE_ALREADY_FINISHED = Voting has already ended. 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. @@ -97,6 +99,8 @@ MAPM_WINS = wygrane MAPM_VOTE_IN_NEXTROUND = Poczekaj na glosowanie w nastepnej rundzie. MAPM_SECOND_VOTE = Drugie glosowanie. MAPM_CHANGELEVEL_NEXTROUND = Mapa zostanie zmieniona w nastepnej rundzie. +MAPM_VOTE_ALREADY_STARTED = Głosowanie już się rozpoczęło. +MAPM_VOTE_ALREADY_FINISHED = Głosowanie już się zakończyło. 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. @@ -148,5 +152,7 @@ MAPM_WINS = побед MAPM_VOTE_IN_NEXTROUND = Подождите, голосование начнется в следующем раунде. MAPM_SECOND_VOTE = Второе голосование. MAPM_CHANGELEVEL_NEXTROUND = Карта сменится в следующем раунде. +MAPM_VOTE_ALREADY_STARTED = Голосование уже началось. +MAPM_VOTE_ALREADY_FINISHED = Голосование уже завершилось. MAPM_EARLY_FINISH_VOTE = Проголосовали все игроки,^3 досрочно^1 завершаем голосование. MAPM_FORCE_VOTE_BY_ONLINE = Принудительное голосование за смену карты. Несоответствие онлайна текущей карте. diff --git a/cstrike/addons/amxmodx/scripting/map_manager_rtv.sma b/cstrike/addons/amxmodx/scripting/map_manager_rtv.sma index f586378..dcea5ab 100644 --- a/cstrike/addons/amxmodx/scripting/map_manager_rtv.sma +++ b/cstrike/addons/amxmodx/scripting/map_manager_rtv.sma @@ -42,6 +42,8 @@ new g_iVotes; new g_sPrefix[48]; +new g_sNextMap[MAPNAME_LENGTH]; + public plugin_init() { register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR); @@ -75,8 +77,16 @@ public client_disconnected(id) } public clcmd_rtv(id) { - if(is_vote_started() || is_vote_finished() || is_vote_will_in_next_round()) { - // add msg? + if(is_vote_started()) { + client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_VOTE_ALREADY_STARTED"); + return PLUGIN_HANDLED; + } + else if(is_vote_finished()) { + client_print_color(id, print_team_default, "%s^1 %L %L^3 %s.", g_sPrefix, id, "MAPM_VOTE_ALREADY_FINISHED", id, "MAPM_NEXTMAP", g_sNextMap); + return PLUGIN_HANDLED; + } + else if(is_vote_will_in_next_round()) { + client_print_color(id, print_team_default, "%s^1 %L", g_sPrefix, id, "MAPM_VOTE_WILL_BEGIN"); return PLUGIN_HANDLED; } @@ -130,6 +140,8 @@ public mapm_vote_started(type) } public mapm_vote_finished(const map[], type, total_votes) { + copy(g_sNextMap, charsmax(g_sNextMap), map); + if(type == VOTE_BY_RTV && get_num(CHANGE_TYPE) && get_num(CHANGE_AFTER_VOTE)) { client_print_color(0, print_team_default, "%s^1 %L^1 %L.", g_sPrefix, LANG_PLAYER, "MAPM_MAP_CHANGE", get_num(CHATTIME), LANG_PLAYER, "MAPM_SECONDS"); intermission();