From fe0e461c76190cfd43118fe01b9a21b47d517cb9 Mon Sep 17 00:00:00 2001 From: Split Date: Wed, 6 Dec 2006 07:41:38 +0000 Subject: [PATCH] checks if the none option is the majority vote --- plugins/mapchooser.sma | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/mapchooser.sma b/plugins/mapchooser.sma index 4ac83a61..33d49635 100755 --- a/plugins/mapchooser.sma +++ b/plugins/mapchooser.sma @@ -83,11 +83,20 @@ public plugin_init() public checkVotes() { - new b = 0 + new b = 0, smap[32] for (new a = 0; a < g_mapVoteNum; ++a) if (g_voteCount[b] < g_voteCount[a]) b = a + + if (g_voteCount[SELECTMAPS] == g_voteCount[b]) + { + get_cvar_string("amx_nextmap", smap, 31) + client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_NEXT", smap) + log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap) + + return + } if (g_voteCount[SELECTMAPS] > g_voteCount[b]) { @@ -105,8 +114,6 @@ public checkVotes() if (g_voteCount[b] && g_voteCount[SELECTMAPS + 1] <= g_voteCount[b]) set_cvar_string("amx_nextmap", g_mapName[g_nextName[b]]) - new smap[32] - get_cvar_string("amx_nextmap", smap, 31) client_print(0, print_chat, "%L", LANG_PLAYER, "CHO_FIN_NEXT", smap) log_amx("Vote: Voting for the nextmap finished. The nextmap will be %s", smap)