init()
{
	level.hostname = getCvar("sv_hostname");
	if(level.hostname == "")
		level.hostname = "CoDHost";
	setCvar("sv_hostname", level.hostname);
	setCvar("ui_hostname", level.hostname);
	makeCvarServerInfo("ui_hostname", "CoDHost");

	level.motd = getCvar("scr_motd");
	if(level.motd == "")
		level.motd = "";
	setCvar("scr_motd", level.motd);
	setCvar("ui_motd", level.motd);
	makeCvarServerInfo("ui_motd", "");

	level.friendlyfire = getCvar("scr_friendlyfire");
	if(level.friendlyfire == "")
		level.friendlyfire = "0";
	setCvar("scr_friendlyfire", level.friendlyfire, true);
	setCvar("ui_friendlyfire", level.friendlyfire);
	makeCvarServerInfo("ui_friendlyfire", "0");




	level.allowvote = getCvar("g_allowvote");
	if(level.allowvote == "")
		level.allowvote = "1";
	setCvar("g_allowvote", level.allowvote);
	setCvar("ui_allowvote", level.allowvote);
	makeCvarServerInfo("ui_allowvote", "1");

	level.allowvotemaprestart = getCvar("g_allowvotemaprestart");
	if(level.allowvotemaprestart == "")
		level.allowvotemaprestart = "1";
	setCvar("g_allowvotemaprestart", level.allowvotemaprestart);
	setCvar("ui_allowvotemaprestart", level.allowvotemaprestart);
	makeCvarServerInfo("ui_allowvotemaprestart", "1");

	level.allowvotemaprotate = getCvar("g_allowvotemaprotate");
	if(level.allowvotemaprotate == "")
		level.allowvotemaprotate = "1";
	setCvar("g_allowvotemaprotate", level.allowvotemaprotate);
	setCvar("ui_allowvotemaprotate", level.allowvotemaprotate);
	makeCvarServerInfo("ui_allowvotemaprotate", "1");

	level.allowvotemap = getCvar("g_allowvotemap");
	if(level.allowvotemap == "")
		level.allowvotemap = "1";
	setCvar("g_allowvotemap", level.allowvotemap);
	setCvar("ui_allowvotemap", level.allowvotemap);
	makeCvarServerInfo("ui_allowvotemap", "1");

	level.allowvotegametype = getCvar("g_allowvotegametype");
	if(level.allowvotegametype == "")
		level.allowvotegametype = "1";
	setCvar("g_allowvotegametype", level.allowvotegametype);
	setCvar("ui_allowvotegametype", level.allowvotegametype);
	makeCvarServerInfo("ui_allowvotegametype", "1");

	level.allowvotekick = getCvar("g_allowvotekick");
	if(level.allowvotekick == "")
		level.allowvotekick = "1";
	setCvar("g_allowvotekick", level.allowvotekick);
	setCvar("ui_allowvotekick", level.allowvotekick);
	makeCvarServerInfo("ui_allowvotekick", "1");


	for(;;)
	{
		updateServerSettings();
		wait 5;
	}
}

updateServerSettings()
{
	sv_hostname = getCvar("sv_hostname");
	if(level.hostname != sv_hostname)
	{
		level.hostname = sv_hostname;
		setCvar("ui_hostname", level.hostname);
	}

	scr_motd = getCvar("scr_motd");
	if(level.motd != scr_motd)
	{
		level.motd = scr_motd;
		setCvar("ui_motd", level.motd);
	}

	scr_friendlyfire = getCvar("scr_friendlyfire");
	if(level.friendlyfire != scr_friendlyfire)
	{
		level.friendlyfire = scr_friendlyfire;
		setCvar("ui_friendlyfire", level.friendlyfire);
	}



	g_allowvote = getCvar("g_allowvote");
	if(level.allowvote != g_allowvote)
	{
		level.allowvote = g_allowvote;
		setCvar("ui_allowvote", level.allowvote);
	}

	g_allowvotemaprestart = getCvar("g_allowvotemaprestart");
	if(level.allowvotemaprestart != g_allowvotemaprestart)
	{
		level.allowvotemaprestart = g_allowvotemaprestart;
		setCvar("ui_allowvotemaprestart", level.allowvotemaprestart);
	}

	g_allowvotemaprotate = getCvar("g_allowvotemaprotate");
	if(level.allowvotemaprotate != g_allowvotemaprotate)
	{
		level.allowvotemaprotate = g_allowvotemaprotate;
		setCvar("ui_allowvotemaprotate", level.allowvotemaprotate);
	}

	g_allowvotemap = getCvar("g_allowvotemap");
	if(level.allowvotemap != g_allowvotemap)
	{
		level.allowvotemap = g_allowvotemap;
		setCvar("ui_allowvotemap", level.allowvotemap);
	}

	g_allowvotegametype = getCvar("g_allowvotegametype");
	if(level.allowvotegametype != g_allowvotegametype)
	{
		level.allowvotegametype = g_allowvotegametype;
		setCvar("ui_allowvotegametype", level.allowvotegametype);
	}

	g_allowvotekick = getCvar("g_allowvotekick");
	if(level.allowvotekick != g_allowvotekick)
	{
		level.allowvotekick = g_allowvotekick;
		setCvar("ui_allowvotekick", level.allowvotekick);
	}

}


