checks if the none option is the majority vote

This commit is contained in:
Split 2006-12-06 07:41:38 +00:00
parent 935da9f0de
commit fe0e461c76

View File

@ -83,12 +83,21 @@ 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])
{
new mapname[32]
@ -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)