
logogfx()
{
	level endon("ex_gameover");
	self endon("disconnect");
	self endon("ex_dead");

	logo = "gfx/custom/logo_cod.tga";

	if(isDefined(self.ex_srvlogoback))
	{
		self.ex_srvlogoback fadeOverTime(1); 
		self.ex_srvlogoback.alpha = 0;
		wait 1;
	}
	else
	{
		self.ex_srvlogoback = newClientHudElem(self);
		self.ex_srvlogoback.x = 2;
		self.ex_srvlogoback.y = 2;
		self.ex_srvlogoback.alignX = "left";
		self.ex_srvlogoback.alignY = "top";
		self.ex_srvlogoback.sort = -1;
		self.ex_srvlogoback.alpha = 0;
	}

	if(!isDefined(self.ex_srvlogofront))
	{
		self.ex_srvlogofront = newClientHudElem(self);
		self.ex_srvlogofront.x = 2;
		self.ex_srvlogofront.y = 2;
		self.ex_srvlogofront.alignX = "left";
		self.ex_srvlogofront.alignY = "top";
		self.ex_srvlogofront.sort = 0;
		self.ex_srvlogofront.alpha = 0;
	}

	if(isPlayer(self))
	{
		self.ex_srvlogofront setShader("gfx/custom/logo_extreme.tga", 64, 64);
		self.ex_srvlogofront fadeOverTime(0.8);
		self.ex_srvlogofront.alpha = 0.8;
	}

	wait 0.4;

	if(isPlayer(self))
	{	
		if(level.ex_logopic == 2)
		{
			if(self.pers["team"] == "allies")
			{
				switch(game["allies"])
				{
					case "american":	logo = "gfx/custom/logo_american.tga";		break;
					case "british":		logo = "gfx/custom/logo_british.tga";			break;
					default:					logo = "gfx/custom/logo_russian.tga";			break;
				}
			}
			else if(self.pers["team"] == "axis") logo = "gfx/custom/logo_german.tga";
		}

		if(isDefined(self.ex_srvlogoback))
		{
			self.ex_srvlogoback setShader(logo, 64, 64);
			self.ex_srvlogoback fadeOverTime(1.6); 
			self.ex_srvlogoback.alpha = 0.8;
			wait 1.6;
		}
	}

	if(isPlayer(self) && isDefined(self.ex_srvlogofront)) self.ex_srvlogofront destroy();
}