
init()
{
	org_allowvote = getCvar("g_allowvote");
	if(org_allowvote == "0") return;
	setCvar("g_allowvote", "0");

	if(level.ex_cvdelay_players)
	{
		for(;;)
		{
			players = getentarray("player", "classname");
			playercount = players.size;
			for(i = 0; i < players.size; i++)
			{
				if(isDefined(players[i].pers["team"]) && players[i].pers["team"] == "spectator" || players[i].sessionteam == "spectator")
					playercount--;
			}
			if(playercount >= level.ex_cvdelay_players) break;
			wait(1);
		}
	}

	wait(level.ex_cvdelay);
	setCvar("g_allowvote", org_allowvote);
}
