/*
	Plugin : Full Bright
	Author : Ali Sajjad
*/
init(x)
{
	thread OnConnect();
	
}
OnConnect()
{
	level endon("endmap");
	while( 1 )
	{
		level waittill("connected",player);
		if(!isDefined(player getStat(1050)))
			player setStat(1050,0);
		if(player getStat(1050) == 1)
			player setClientDvar("r_fullbright", 1);self iPrintln("Full Bright^2[ON]");
		player braxi\_common::clientCmd("bind M openscriptmenu -1 fullbright");
		player thread MenuResponse();
		player iprintln("Press ^2[M] ^7 To enable FullBright");
		
	}
}
MenuResponse()
{
	self endon("disconnect");
	for(;;)
	{
		self waittill("menuresponse", menu, response);
		if(self getStat(1050) == 0  && response == "fullbright")
		{
			self setClientDvar("r_fullbright", 1);
			self setStat(1050,1);
			self iPrintln("Full Bright^2[ON]");
		}
		else if(self getStat(1050) == 1 && response == "fullbright") 
		{
			self setClientDvar("r_fullbright", 0);
			self setStat(1050,0);
			self iPrintln("Full Bright^1[OFF]");
		}
	}
}