
cleanallhud()
{
	if(isDefined(level.clock)) level.clock destroy();
	if(isDefined(level.ex_axisicon)) level.ex_axisicon destroy();
	if(isDefined(level.ex_axisnumber)) level.ex_axisnumber destroy();
	if(isDefined(level.ex_deadaxisicon)) level.ex_deadaxisicon destroy();
	if(isDefined(level.ex_deadaxisnumber)) level.ex_deadaxisnumber destroy();
	if(isDefined(level.ex_alliedicon)) level.ex_alliedicon destroy();
	if(isDefined(level.ex_alliednumber)) level.ex_alliednumber destroy();
	if(isDefined(level.ex_deadalliedicon)) level.ex_deadalliedicon destroy();
	if(isDefined(level.ex_deadalliednumber)) level.ex_deadalliednumber destroy();
	if(isDefined(level.ex_gtsmsg)) level.ex_gtsmsg destroy();
	if(isDefined(level.ex_mapannouncer)) level.ex_mapannouncer destroy();

	// fade out modinfo, move to centre and fade in
	if(isDefined(level.ex_modinfo))
	{
		level.ex_modinfo fadeOverTime(1);
		level.ex_modinfo.alpha = 0;
		wait 1;
		level.ex_modinfo.x = 320;
		level.ex_modinfo.alignX = "center";
		level.ex_modinfo fadeOverTime(1);
		level.ex_modinfo.alpha = 0.8;
		wait 1;
	}
}

cleanplayerend()
{
	maps\mp\gametypes\_hud_teamscore::removePlayerHUD();
	maps\mp\gametypes\_hud_playerscore::removePlayerHUD();
}

cleanplayer()
{
	[[level.ex_clearlnb]]("self",5);

	if(level.ex_ranksystem)
	{
		if(isDefined(self.ex_rankhud0)) self.ex_rankhud0 destroy();
		if(isDefined(self.ex_rankhud1)) self.ex_rankhud1 destroy();
		if(isDefined(self.ex_rankhud2)) self.ex_rankhud2 destroy();
	}

	if(level.ex_statshud)
	{
		if(isdefined(self.statshud_left)) self.statshud_left destroy();
		if(isdefined(self.statshud_img))
		{
			for(i = 0; i < self.statshud_img.size; i++)
				if(isdefined(self.statshud_img[i])) self.statshud_img[i] destroy();
		}
		if(isdefined(self.statshud_val))
		{
			for(i = 0; i < self.statshud_val.size; i++)
				if(isdefined(self.statshud_val[i])) self.statshud_val[i] destroy();
		}
		if(isdefined(self.statshud_right)) self.statshud_right destroy();
	}

	if(isDefined(self.mine_hud_icon)) self.mine_hud_icon destroy();
	if(isDefined(self.mine_hud_ammo)) self.mine_hud_ammo destroy();
	if(isDefined(self.mine_hud_warn)) self.mine_hud_warn destroy();
	if(isDefined(self.mine_hud_defuse)) self.mine_hud_defuse destroy();
	if(isDefined(self.mine_hud_plant)) self.mine_hud_plant destroy();
	if(isDefined(self.mine_hud_progress_bg)) self.mine_hud_progress_bg destroy();
	if(isDefined(self.mine_hud_progress)) self.mine_hud_progress destroy();

	if(isDefined(self.turret_indicator)) self.turret_indicator destroy();
	if(isDefined(self.turret_msg)) self.turret_msg destroy();

	if(isDefined(self.ex_spwpro)) self.ex_spwpro destroy();
	if(isDefined(self.ex_laserdot)) self.ex_laserdot destroy();
	if(isDefined(self.ex_sprinthud)) self.ex_sprinthud destroy();
	if(isDefined(self.ex_sprinthud_back)) self.ex_sprinthud_back destroy();
	if(isDefined(self.ex_sprinthud_hint)) self.ex_sprinthud_hint destroy();
	if(isDefined(self.ex_laserdot)) self.ex_laserdot destroy();
	if(isDefined(self.ex_firstaidicon)) self.ex_firstaidicon destroy();
	if(isDefined(self.ex_firstaidtxt)) self.ex_firstaidtxt destroy();
	if(isDefined(self.ex_firstaidval)) self.ex_firstaidval destroy();
	if(isDefined(self.mortar_available_icon)) self.mortar_available_icon destroy();
	if(isDefined(self.artillery_available_icon)) self.artillery_available_icon destroy();
	if(isDefined(self.airstrike_available_icon)) self.airstrike_available_icon destroy();
	if(isDefined(self.ex_binocular_hint)) self.ex_binocular_hint destroy();
	if(isdefined(self.ex_parachute)) self.ex_parachute delete();
	if(isdefined(self.ex_anchor)) self.ex_anchor delete();
	if(isDefined(self.floatingmodel)) self.floatingmodel delete();

	if(isDefined(self.ex_bloodonscreen)) self.ex_bloodonscreen destroy();
	if(isDefined(self.ex_bloodonscreen1)) self.ex_bloodonscreen1 destroy();
	if(isDefined(self.ex_bloodonscreen2)) self.ex_bloodonscreen2 destroy();
	if(isDefined(self.ex_bloodonscreen3)) self.ex_bloodonscreen3 destroy();

	if(isDefined(self.ex_expmsg1)) self.ex_expmsg1 destroy();
	if(isDefined(self.ex_expmsg2)) self.ex_expmsg2 destroy();
	if(isDefined(self.ex_expmsg3)) self.ex_expmsg3 destroy();

	if(isDefined(self.ex_pbbgrd)) self.ex_pbbgrd destroy();
	if(isDefined(self.ex_pb)) self.ex_pb destroy();
	if(isDefined(self.ex_actimer)) self.ex_actimer destroy();
	if(isDefined(self.ex_tripwarning)) self.ex_tripwarning destroy();

	if(isDefined(self.ex_bleedmsg)) self.ex_bleedmsg destroy();
	if(isDefined(self.ex_roundnumber)) self.ex_roundnumber destroy();

	if(level.ex_bulletholes && isDefined(self.ex_bulletholes))
	{
		for(i = 0; i < self.ex_bulletholes.size; i++)
		{
			if(isDefined(self.ex_bulletholes[i])) self.ex_bulletholes[i] destroy();
		}
	}

	if(isDefined(self.ex_healthbar)) self.ex_healthbar destroy();
	if(isDefined(self.ex_healthback)) self.ex_healthback destroy();
	if(isDefined(self.ex_healthcross)) self.ex_healthcross destroy();

	if(isDefined(self.ex_srvlogoback)) self.ex_srvlogoback destroy();
	if(isDefined(self.ex_srvlogofront)) self.ex_srvlogofront destroy();

	if(isDefined(self.ex_headmarker))
	{
		self.ex_headmarker stoploopsound();
		self.ex_sprintreco = false;
		self.ex_headmarker unlink();
		self.ex_headmarker delete();
	}

	if(isDefined(self.ex_spinemarker))
	{
		self.ex_spinemarker unlink();
		self.ex_spinemarker delete();
	}

	if(isDefined(self.ex_eyemarker))
	{
		self.ex_eyemarker unlink();
		self.ex_eyemarker delete();
	}

	if(isDefined(self.ex_thumbmarker))
	{
		self.ex_thumbmarker unlink();
		self.ex_thumbmarker delete();
	}

	if(isDefined(self.ex_lankmarker))
	{
		self.ex_lankmarker unlink();
		self.ex_lankmarker delete();
	}

	if(isDefined(self.ex_rankmarker))
	{
		self.ex_rankmarker unlink();
		self.ex_rankmarker delete();
	}

	if(isDefined(self.ex_lwristmarker))
	{
		self.ex_lwristmarker unlink();
		self.ex_lwristmarker delete();
	}

	if(isDefined(self.ex_rwristmarker))
	{
		self.ex_rwristmarker unlink();
		self.ex_rwristmarker delete();
	}
}
