#include extreme\_ex_weapons;
#include extreme\_ex_lin;
#include extreme\_ex_drm;

main()
{
	//****************************************************************************
	// eXtreme+ setup commonly used function alias
	//****************************************************************************
	level thread extreme\_ex_drm::drm_init();
	level.ex_drm = extreme\_ex_drm::cvardef;         // [[level.ex_drm]]
	level thread extreme\_ex_lin::IsLinuxServer();
	level.ex_cvardef = extreme\_ex_utils::cvardef;   // [[level.ex_cvardef]]
	level.ex_clearlnb = extreme\_ex_utils::excllnbo;
	level.ex_PrecacheShader = extreme\_ex_utils::ex_PrecacheShader;
	level.ex_PrecacheHeadIcon = extreme\_ex_utils::ex_PrecacheHeadIcon;
	level.ex_PrecacheStatusIcon = extreme\_ex_utils::ex_PrecacheStatusIcon;
	level.ex_PrecacheModel = extreme\_ex_utils::ex_PrecacheModel;
	level.ex_PrecacheItem = extreme\_ex_utils::ex_PrecacheItem;
	level.ex_PrecacheString = extreme\_ex_utils::ex_PrecacheString;
	level.ex_precacheForcedWeapon = extreme\_ex_utils::ex_precacheForcedWeapon;
	level.ex_PrecacheMenuItem = extreme\_ex_utils::ex_PrecacheMenuItem;
	level.ex_PrecacheShellShock = extreme\_ex_utils::ex_PrecacheShellShock;
	level.ex_getStance = extreme\_ex_utils::GetStance;
	level.ex_vectorscale = extreme\_ex_utils::vectorscale;
	level.ex_vectormulti = extreme\_ex_utils::vectormulti;
	
	// Override callbackPlayerDamage
	level.ex_orignalPlayerDamage = level.callbackPlayerDamage;
	level.callbackPlayerDamage = extreme\_ex_main::explayerdamage;

	//****************************************************************************
	// Conversion of stock server Cvars
	//****************************************************************************
	setCvar("g_allowvote", [[level.ex_drm]]("g_allowvote", 1, 0, 1, "int"));
	setCvar("g_deadchat", [[level.ex_drm]]("g_deadchat", 0, 0, 1, "int"));
	setCvar("g_debugdamage", [[level.ex_drm]]("g_debugdamage", 0, 0, 1, "int"));
	setCvar("g_oldvoting", [[level.ex_drm]]("g_oldvoting", 1, 0, 1, "int"));
	setCvar("scr_drawfriend", [[level.ex_drm]]("scr_drawfriend", 0, 0, 1, "int"));
	setCvar("scr_forcerespawn", [[level.ex_drm]]("scr_forcerespawn", 0, 0, 1, "int"));
	setCvar("scr_friendlyfire", [[level.ex_drm]]("scr_friendlyfire", 0, 0, 3, "int"));
	setCvar("scr_killcam", [[level.ex_drm]]("scr_killcam", 0, 0, 1, "int"));
	setCvar("scr_teambalance", [[level.ex_drm]]("scr_teambalance", 0, 0, 1, "int"));
	setCvar("scr_spectateenemy", [[level.ex_drm]]("scr_spectateenemy", 0, 0, 1, "int"));
	setCvar("scr_spectatefree", [[level.ex_drm]]("scr_spectatefree", 1, 0, 1, "int"));

	//****************************************************************************
	// Menu item for adding this eXtreme+ server to the favorites
	//****************************************************************************
	level.ex_addtofavorites = [[level.ex_drm]]("ex_addtofavorites", 1, 0, 1, "int");
	level.ex_addtofavorites_ip = [[level.ex_drm]]("ex_addtofavorites_ip", "", "", "", "string");

	//****************************************************************************
	// Initialize map array for in-game and end-game map vote systems
	//****************************************************************************
	level.ex_stock_maps = [[level.ex_drm]]("ex_stock_maps", 1, 0, 1, "int");
	level thread extreme\_ex_mapvote::init();

	//****************************************************************************
	// Weapons on back
	//****************************************************************************
	level.ex_weaponsonback = [[level.ex_drm]]("ex_weaponsonback", 1, 0, 1, "int");
	
	//****************************************************************************
	// Switch Zoom Scopes
	//****************************************************************************
	level.ex_switch_scopezoom = [[level.ex_drm]]("ex_switch_scopezoom", 1, 0, 1, "int");
	
	//****************************************************************************
	// Closekill
	//****************************************************************************
	//level.ex_closekill = [[level.ex_drm]]("ex_closekill", 0, 0, 1, "int");
	//level.ex_closekill_range = [[level.ex_drm]]("ex_closekill_range", 15, 0, 999, "int");
	
	//****************************************************************************
	// Antirun
	//****************************************************************************
	level.ex_antirun = [[level.ex_drm]]("ex_antirun", 0, 0, 1, "int");
	level.ex_antirun_distance = [[level.ex_drm]]("ex_antirun_distance", 500, 100, 9999, "int");

	//****************************************************************************
	// Inactivity Monitor
	//****************************************************************************
	level.ex_inactive_plyr = [[level.ex_drm]]("ex_inactive_plyr", 0, 0, 1, "int");
	level.ex_inactive_spec = [[level.ex_drm]]("ex_inactive_spec", 0, 0, 1, "int");
	level.ex_inactive_time = [[level.ex_drm]]("ex_inactive_time", 15, 1, 999, "int");
	level.ex_afk = [[level.ex_drm]]("ex_afk", 1, 0, 1, "int");

	//****************************************************************************
	// Server redirection
	//****************************************************************************
	level.ex_redirect = [[level.ex_drm]]("ex_redirect", 0, 0, 1, "int");
	level.ex_redirect_ip = [[level.ex_drm]]("ex_redirect_ip", "", "", "", "string");
	level.ex_redirect_pause = [[level.ex_drm]]("ex_redirect_pause", 10, 5, 60, "int");
	level.ex_redirect_reason = [[level.ex_drm]]("ex_redirect_reason", 0, 0, 3, "int");
	level.ex_redirect_logic = [[level.ex_drm]]("ex_redirect_logic", 0, 0, 2, "int");
	level.ex_redirect_priority = [[level.ex_drm]]("ex_redirect_priority", 0, 0, 4, "int");
	level.ex_redirect_hint = [[level.ex_drm]]("ex_redirect_hint", 1, 0, 1, "int");

	//****************************************************************************
	// Parachuting
	//****************************************************************************
	level.ex_parachutes = [[level.ex_drm]]("ex_parachutes", 0, 0, 3, "int");
	level.ex_parachutesonlyattackers = [[level.ex_drm]]("ex_parachutes_only_attackers", 0, 0, 1, "int");
	level.ex_parachutesprotection = [[level.ex_drm]]("ex_parachutes_protection", 2, 0, 2, "int");
	level.ex_parachuteslimitaltitude = [[level.ex_drm]]("ex_parachutes_limit_altitude", 2000, 0, 6000, "int");

	//****************************************************************************
	// Long range rifle hitloc
	//****************************************************************************
	level.ex_lrhitloc = [[level.ex_drm]]("ex_lrhitloc", 0, 0, 1, "int");
	level.ex_lrhitloc_unit = [[level.ex_drm]]("ex_lrhitloc_unit", 1, 0, 1, "int");
	level.ex_lrhitloc_msg = [[level.ex_drm]]("ex_lrhitloc_msg", 1, 0, 2, "int");
	level.ex_lrhitloc_head = [[level.ex_drm]]("ex_lrhitloc_head", 100, 1, 100, "int");
	level.ex_lrhitloc_neck = [[level.ex_drm]]("ex_lrhitloc_neck", 90, 1, 100, "int");
	level.ex_lrhitloc_torso_upper = [[level.ex_drm]]("ex_lrhitloc_torso_upper", 80, 1, 100, "int");
	level.ex_lrhitloc_torso_lower = [[level.ex_drm]]("ex_lrhitloc_torso_lower", 70, 1, 100, "int");
	level.ex_lrhitloc_right_leg_upper = [[level.ex_drm]]("ex_lrhitloc_right_leg_upper", 60, 1, 100, "int");
	level.ex_lrhitloc_right_leg_lower = [[level.ex_drm]]("ex_lrhitloc_right_leg_lower", 40, 1, 100, "int");
	level.ex_lrhitloc_left_leg_upper = [[level.ex_drm]]("ex_lrhitloc_left_leg_upper", 60, 1, 100, "int");
	level.ex_lrhitloc_left_leg_lower = [[level.ex_drm]]("ex_lrhitloc_left_leg_lower", 40, 1, 100, "int");
	level.ex_lrhitloc_right_arm_upper = [[level.ex_drm]]("ex_lrhitloc_right_arm_upper", 50, 1, 100, "int");
	level.ex_lrhitloc_right_arm_lower = [[level.ex_drm]]("ex_lrhitloc_right_arm_lower", 40, 1, 100, "int");
	level.ex_lrhitloc_left_arm_upper = [[level.ex_drm]]("ex_lrhitloc_left_arm_upper", 50, 1, 100, "int");
	level.ex_lrhitloc_left_arm_lower = [[level.ex_drm]]("ex_lrhitloc_left_arm_lower", 40, 1, 100, "int");
	level.ex_lrhitloc_right_hand = [[level.ex_drm]]("ex_lrhitloc_right_hand", 30, 1, 100, "int");
	level.ex_lrhitloc_left_hand = [[level.ex_drm]]("ex_lrhitloc_left_hand", 30, 1, 100, "int");
	level.ex_lrhitloc_right_foot = [[level.ex_drm]]("ex_lrhitloc_right_foot", 20, 1, 100, "int");
	level.ex_lrhitloc_left_foot = [[level.ex_drm]]("ex_lrhitloc_left_foot", 20, 1, 100, "int");

	//****************************************************************************
	// eXtreme+ RCON
	//****************************************************************************
	level.ex_rcon = [[level.ex_drm]]("ex_rcon", 0, 0, 1, "int");
	level.ex_rcon_mode = [[level.ex_drm]]("ex_rcon_mode", 0, 0, 1, "int");
	level.ex_rcon_autopass = [[level.ex_drm]]("ex_rcon_autopass", 0, 0, 1, "int");
	level.ex_rcon_access_default = [[level.ex_drm]]("ex_rcon_access_default", 127, 1, 127, "int");
	level.ex_rcon_truncate = [[level.ex_drm]]("ex_rcon_truncate", 1, 0, 1, "int");
	level.ex_rcon_color = [[level.ex_drm]]("ex_rcon_color", 1, 0, 1, "int");
	level.ex_rcon_playeraction = [[level.ex_drm]]("ex_rcon_playeraction", 0, 0, 20, "int");
	level.ex_rcon_playermodel = [[level.ex_drm]]("ex_rcon_playermodel", 0, 0, 7, "int");
	level.ex_rcon_mapaction = [[level.ex_drm]]("ex_rcon_mapaction", 0, 0, 5, "int");

	//****************************************************************************
	// eXtreme+ ambient fx control
	//****************************************************************************
	level.ex_ambmapfog = [[level.ex_drm]]("ex_ambmapfog", 1, 0, 1, "int");
	level.ex_ambmapsound = [[level.ex_drm]]("ex_ambmapsound", 1, 0, 1, "int");
	level.ex_ambsoundfx = [[level.ex_drm]]("ex_ambsoundfx", 1, 0, 1, "int");
	level.ex_ambfirefx = [[level.ex_drm]]("ex_ambfirefx", 1, 0, 1, "int");
	level.ex_ambfogbankfx = [[level.ex_drm]]("ex_ambfogbankfx", 1, 0, 1, "int");
	level.ex_ambsmokefx = [[level.ex_drm]]("ex_ambsmokefx", 1, 0, 1, "int");
	level.ex_ambfliesfx = [[level.ex_drm]]("ex_ambfliesfx", 1, 0, 1, "int");
	level.ex_ambdustfx = [[level.ex_drm]]("ex_ambdustfx", 1, 0, 1, "int");
	level.ex_ambsnowfx = [[level.ex_drm]]("ex_ambsnowfx", 1, 0, 1, "int");
	level.ex_air_raid = [[level.ex_drm]]("ex_air_raid", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ make current gametype and map as level variables
	//****************************************************************************
	level.ex_currentgt = getcvar("g_gametype");
	level.ex_currentmap = getcvar("mapname");

	//****************************************************************************
	// eXtreme+ map pause / gametype start delay
	//****************************************************************************
	level.ex_gtsdelay = [[level.ex_drm]]("ex_gtsdelay",0,0,60,"int");

	//****************************************************************************
	// eXtreme+ music options
	//****************************************************************************
	level.ex_specmusic= [[level.ex_drm]]("ex_specmusic",0,0,1,"int");
	level.ex_deathmusic = [[level.ex_drm]]("ex_deathmusic",0,0,1,"int");
	level.ex_endmusic = [[level.ex_drm]]("ex_endmusic", 0, 0, 1, "int");
	level.ex_endmusic_time = [[level.ex_drm]]("ex_endmusic_time", 10, 0, 30, "float");
	level.ex_mvmusic = [[level.ex_drm]]("ex_votemusic",0,0,1,"int");
	level.ex_statsmusic = [[level.ex_drm]]("ex_statsmusic",0,0,1,"int");
	level.ex_intromusic = [[level.ex_drm]]("ex_intromusic",0,0,3,"int"); // Tnic
	
	// end music override!
	if(level.ex_endmusic)
	{
		level.ex_mvmusic = 0;
		level.ex_statsmusic = 0;
	}

	//****************************************************************************
	// eXtreme+ gametype checks
	//****************************************************************************
	// teamplay
	if(level.ex_currentgt != "dm" && level.ex_currentgt != "hm" && level.ex_currentgt != "ihtf" && level.ex_currentgt != "lms") level.ex_teamplay = true;
		else level.ex_teamplay = false;

	// roundbased
	if(level.ex_currentgt == "esd" || level.ex_currentgt == "lts" || level.ex_currentgt == "rbcnq" || level.ex_currentgt == "rbctf" || level.ex_currentgt == "sd") level.ex_roundbased = true;
		else level.ex_roundbased = false;

	// flagbased
	if(level.ex_currentgt == "ctf" || level.ex_currentgt == "ctfb" || level.ex_currentgt == "htf" || level.ex_currentgt == "ihtf" || level.ex_currentgt == "rbctf") level.ex_flagbased = true;
		else level.ex_flagbased = false;

	// radiobased
	if(level.ex_currentgt == "chq" || level.ex_currentgt == "hq") level.ex_radiobased = true;
		else level.ex_radiobased = false;

	// setup gametype common variables
	thread extreme\_ex_gtcommon::init();

	//****************************************************************************
	// eXtreme+ gametype options
	//****************************************************************************
	level.ex_swapteams = [[level.ex_drm]]("ex_swapteams", 0, 0, 1, "int");
	level.ex_reward_melee = [[level.ex_drm]]("ex_reward_melee", 0, 0, 5, "int");
	level.ex_reward_headshot = [[level.ex_drm]]("ex_reward_headshot", 0, 0, 5, "int");
	level.ex_reward_teamkill = [[level.ex_drm]]("ex_reward_teamkill", 0, 0, 1, "int");

	//Half-Time TeamSwap
	if(level.ex_roundbased) level.half_time = (level.roundlimit /2 +1);

	//****************************************************************************
	// eXtreme+ diagnostics and debug
	//****************************************************************************
	level.ex_diag_bots = [[level.ex_drm]]("ex_diag_bots", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ security GUID check (disabled until COD2 guid function is fixed)
	//****************************************************************************
	level.ex_security = [[level.ex_drm]]("ex_security", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ define level variables
	//****************************************************************************
	level.ex_gameover = false;
	level.ex_fbannounce = true;
	level.ex_flakison = false;

	// set plane variables
	level.ex_axisapinsky = 0;
	level.ex_allieapinsky = 0;
	level.ex_paxisapinsky = 0;
	level.ex_pallieapinsky = 0;
	level.ex_planescrashed = 0;

	// Set up number of voices
	level.ex_voices["german"] = 3;
	level.ex_voices["american"] = 7;
	level.ex_voices["russian"] = 6;
	level.ex_voices["british"] = 6;

	// no! its not an XBOX360
	level.splitscreen = false;
	level.xenon = false;

	//****************************************************************************
	// eXtreme+ log file
	//****************************************************************************
	level.ex_logfile = [[level.ex_drm]]("ex_log_file", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ bleeding
	//****************************************************************************
	level.ex_bleeding = [[level.ex_drm]]("ex_bleeding", 0, 0, 1, "int");

	if(level.ex_bleeding)
	{
		level.ex_startbleed = [[level.ex_drm]]("ex_startbleed", 80, 1, 99, "int");
		level.ex_maxbleed = [[level.ex_drm]]("ex_maxbleed", 100, 0, 100, "int");
		level.ex_bleedmsg = [[level.ex_drm]]("ex_bleedmsg", 0, 0, 3, "int");
		level.ex_bleedsound = [[level.ex_drm]]("ex_bleedsound", 0, 0, 3, "int");
	}
	else level.ex_bleedmsg = 0;

	//****************************************************************************
	// eXtreme+ dead body handling
	//****************************************************************************
	level.ex_deadbodyfx = [[level.ex_drm]]("ex_deadbodyfx", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ bulletholes
	//****************************************************************************
	level.ex_bulletholes = [[level.ex_drm]]("ex_bulletholes", 0, 0, 2, "int");

	//****************************************************************************
	// eXtreme+ range finder
	//****************************************************************************
	level.ex_rangefinder = [[level.ex_drm]]("ex_rangefinder", 0, 0, 1, "int");
	level.ex_rfrange = [[level.ex_drm]]("ex_rfunit", 1, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ stance shoot delay monitor
	//****************************************************************************
	level.ex_stanceshoot = [[level.ex_drm]]("ex_stanceshoot", 0, 0, 3, "int");
	level.ex_jump_sensitivity = [[level.ex_drm]]("ex_jump_sensitivity", 5, 0, 10, "int");

	//****************************************************************************
	// eXtreme+ rank system
	//****************************************************************************
	level.ex_ranksystem = [[level.ex_drm]]("ex_ranksystem", 0, 0, 1, "int");
	level.ex_rankhud = [[level.ex_drm]]("ex_rankhud", 0, 0, 1, "int");
	level.ex_rank_announce = [[level.ex_drm]]("ex_rank_announce", 0, 0, 1, "int");
	level.ex_rank_promo_addnades = [[level.ex_drm]]("ex_rank_promo_addnades", 1, 0, 1, "int");

	// set ranksystem values
	if(level.ex_ranksystem)
	{
		game["mortar"] = "tank_shell";
		game["artillery"] = "artillery";
		game["airstrike"] = "compassping_explosion";

		for(i = 0; i < 8; i++)
		{
			// gun clips
			game["rank_ammo_gunclips_" + i] = [[level.ex_drm]]("ex_rank_gunclips_" + i, i, 0, 12, "int");
	
			// pistol clips
			game["rank_ammo_pistolclips_" + i]= [[level.ex_drm]]("ex_rank_pistolclips_" + i, i, 0, 12, "int");
	
			// grenades
			game["rank_ammo_grenades_" + i] = [[level.ex_drm]]("ex_rank_grenades_" + i, i, 0, 9, "int");
	
			// smoke grenades
			game["rank_ammo_smoke_grenades_" + i] = [[level.ex_drm]]("ex_rank_smoke_" + i, i, 0, 9, "int");
	
			// landmines
			game["rank_ammo_landmines_" + i] = [[level.ex_drm]]("ex_rank_landmines_" + i, i, 0, 9, "int");

			// first aid kits
			game["rank_firstaid_kits_" + i] = [[level.ex_drm]]("ex_rank_firstaid_" + i, i, 0, 9, "int");
	
			// set points required for each rank
			game["rank_" + i] = [[level.ex_drm]]("ex_rank_points_" + i, 5 * i, 0, 200, "int");
		}
	
		// set up wmd's	 - mortars
		level.ex_rank_mortar = [[level.ex_drm]]("ex_rank_mortar", 3, 0, 12, "int");
		level.ex_rank_mortar_first = [[level.ex_drm]]("ex_rank_mortar_first", 10, 10, 300, "int");
		level.ex_rank_mortar_int = [[level.ex_drm]]("ex_rank_mortar_int", 10, 10, 600, "int");
		mradius = [[level.ex_drm]]("ex_rank_mortar_radius", 1, 1, 3, "int");

		// switch for friendly fire check
		level.ex_frndly = [[level.ex_drm]]("ex_frndly", 0, 0, 1, "int");

		switch(mradius)
		{
			case 1:	radius = 1000;	break;
			case 2: radius = 750;	break;
			default:	radius = 500;	break;
		}
		
		level.ex_rank_mortar_radius = radius;
	
		// set up wmd's	 - artillery
		level.ex_rank_artillery = [[level.ex_drm]]("ex_rank_artillery", 6, level.ex_rank_mortar + 1, 12, "int");
		level.ex_rank_artillery_first = [[level.ex_drm]]("ex_rank_artillery_first", 10, 10, 300, "int");
		level.ex_rank_artillery_int = [[level.ex_drm]]("ex_rank_artillery_int", 10, 10, 600, "int");
		artradius = [[level.ex_drm]]("ex_rank_artillery_radius", 1, 1, 3, "int");

		switch(artradius)
		{
			case 1:	radius = 1000;	break;
			case 2: radius = 750;	break;
			default:	radius = 500;	break;
		}	

		level.ex_rank_artillery_radius = radius;
	
		// set up wmd's	 - airstrike
		level.ex_rank_airstrike = [[level.ex_drm]]("ex_rank_airstrike", 9, level.ex_rank_artillery + 1, 12, "int");
		level.ex_rank_airstrike_first = [[level.ex_drm]]("ex_rank_airstrike_first", 10, 10, 300, "int");
		level.ex_rank_airstrike_int = [[level.ex_drm]]("ex_rank_airstrike_int", 10, 10, 600, "int");
		astradius = [[level.ex_drm]]("ex_rank_airstrike_radius", 1, 1, 3, "int");

		// rank for napalm
		level.ex_rank_napalm = [[level.ex_drm]]("ex_rank_napalm", 10, level.ex_rank_airstrike + 1, 12, "int");
	
		switch(astradius)
		{
			case 1:	radius = 1000;	break;
			case 2: radius = 750;	break;
			default:	radius = 500;	break;
		}

		level.ex_rank_airstrike_radius = radius;

		// set other ranksystem variables	
		level.ex_rank_wmdtype = [[level.ex_drm]]("ex_rank_wmdtype", 0, 0, 2, "int");
		level.ex_rank_wmd_min = [[level.ex_drm]]("ex_rank_wmd_min", 30, 10, 300, "int");
		level.ex_rank_wmd_max = [[level.ex_drm]]("ex_rank_wmd_max", level.ex_rank_wmd_min + 10, level.ex_rank_wmd_min + 10, 600, "int");
		level.ex_rank_wmd_flare = [[level.ex_drm]]("ex_rank_wmd_flare", 0, 0, 1, "int");
	
		level.ex_rank_allow_mortar = [[level.ex_drm]]("ex_rank_allow_mortar", 0, 0, 1, "int");
		level.ex_rank_allow_artillery = [[level.ex_drm]]("ex_rank_allow_artillery", 0, 0, 1, "int");
		level.ex_rank_allow_airstrike = [[level.ex_drm]]("ex_rank_allow_airstrike", 0, 0, 1, "int");
		level.ex_rank_allow_napalm = [[level.ex_drm]]("ex_rank_allow_napalm", 0, 0, 1, "int");
		level.ex_score = [[level.ex_drm]]("ex_rank_score", 0, 0, 1, "int");
		level.ex_rank_allow_rank = [[level.ex_drm]]("ex_rank_allow_rank", 0, 0, 7, "int");
	}

	//****************************************************************************
	// eXtreme+ tripwires
	//****************************************************************************
	level.ex_tweapon = [[level.ex_drm]]("ex_tripwire", 0, 0, 3, "int");
	level.ex_tweaponlimit = [[level.ex_drm]]("ex_tripwire_limit", 5, 1, 10, "int");
	level.ex_tweaponwarning = [[level.ex_drm]]("ex_tripwire_warning", 1, 0, 1, "int");
	level.ex_tweapon_radius = 12 * [[level.ex_drm]]("ex_tripwire_radius",12, 1, 999, "int");

	if(level.ex_tweapon)
	{
		if(level.ex_teamplay)
		{
			level.ex_tweapons["axis"] = 0;
			level.ex_tweapons["allies"] = 0;
		}
		else level.ex_tweapons = 0;
	}

	//****************************************************************************
	// eXtreme+ taunts
	//****************************************************************************
	level.ex_taunts = [[level.ex_drm]]("ex_taunts", 0, 0, 3, "int");
	
	// disable menu?
	display = 1;
	if(!level.ex_taunts || level.ex_taunts == 2) display = 0;
	setCvar("ui_allow_quicktaunts", display);
	makeCvarServerInfo("ui_allow_quicktaunts", "0");
	setCvar("ui_allow_quicktauntsb", display);
	makeCvarServerInfo("ui_allow_quicktauntsb", "0");

	//****************************************************************************
	// eXtreme+ liberation responses
	//****************************************************************************
	display = 0;
	if(level.ex_currentgt == "lib") display = 1;
	setCvar("ui_allow_quickresponseslib", display);
	makeCvarServerInfo("ui_allow_quickresponseslib", "0");

	//****************************************************************************
	// eXtreme+ blood on screen
	//****************************************************************************
	level.ex_bloodonscreen = [[level.ex_drm]]("ex_bloodonscreen", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ logo
	//****************************************************************************
	level.ex_logopic = [[level.ex_drm]]("ex_logopic", 0, 0, 2, "int");

	//****************************************************************************
	// eXtreme+ force auto-assign on team menu
	//****************************************************************************
	level.ex_forceauto = [[level.ex_drm]]("ex_forceauto", 0, 0, 2, "int");

	//****************************************************************************
	// eXtreme+ livestats!
	//****************************************************************************
	level.ex_livestats = [[level.ex_drm]]("ex_livestats", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ duplicate name check
	//****************************************************************************
	level.ex_namechecker = [[level.ex_drm]]("ex_namechecker", 1, 0, 1, "int");
	level.ex_ncskipwarning = [[level.ex_drm]]("ex_ncskipwarning", 1, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ damage modifiers
	//****************************************************************************
	level.ex_wdmodon = [[level.ex_drm]]("ex_wdmodon", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ announcer - time remaining, score, results, firstblood, player connect
	//****************************************************************************
	level.ex_timeannouncer = [[level.ex_drm]]("ex_announcer", 0, 0, 2, "int");
	level.ex_antime = [[level.ex_drm]]("ex_antime", 0, 0, 1, "int");
	level.ex_anscore = [[level.ex_drm]]("ex_anscore", 0, 0, 1, "int");
	level.ex_anresult = [[level.ex_drm]]("ex_anresult", 0, 0, 1, "int");
	level.ex_firstblood = [[level.ex_drm]]("ex_firstblood", 0, 0, 1, "int");
	level.ex_plcdsound = [[level.ex_drm]]("ex_plcdsound", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ welcome/goodluck sound
	//****************************************************************************
	level.ex_goodluck = [[level.ex_drm]]("ex_goodluck", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ minefields
	//****************************************************************************
	level.ex_minefields = [[level.ex_drm]]("ex_minefields", 1, 0, 3, "int");
	level.ex_gasmine_min = [[level.ex_drm]]("ex_gasmine_min", 25, 1, 100, "int");
	level.ex_gasmine_max = [[level.ex_drm]]("ex_gasmine_max", 30, level.ex_gasmine_min, 100, "int");
	level.ex_napalmmine_min = [[level.ex_drm]]("ex_napalmmine_min", 25, 1, 100, "int");
	level.ex_napalmmine_max = [[level.ex_drm]]("ex_napalmmine_max", 30, level.ex_napalmmine_min, 100, "int");

	//****************************************************************************
	// eXtreme+ death/grenade indicators
	//****************************************************************************
	level.ex_deathicons = [[level.ex_drm]]("ex_deathicons", 0, 0, 1, "int");
	level.ex_grenadeind = [[level.ex_drm]]("ex_grenadeind", 0, 0, 1, "int");
	level.ex_objindicator = [[level.ex_drm]]("ex_objindicator", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ grenade warning system
	//****************************************************************************
	level.ex_grenadewarn = [[level.ex_drm]]("ex_grenadewarn", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ fix corrupt map rotations
	//****************************************************************************
	level.ex_fixmaprotation = [[level.ex_cvardef]]("ex_fix_maprotation", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ random map rotation
	//****************************************************************************
	level.ex_randommaprotation = [[level.ex_cvardef]]("ex_random_maprotation", 0, 0, 2, "int");

	//***************************************************************************
	// eXtreme+ Call Vote delay
	//***************************************************************************
	level.ex_cvdelay = [[level.ex_drm]]("ex_cvdelay", 0, 0, 3600, "int");
	level.ex_cvdelay_players = [[level.ex_drm]]("ex_cvdelay_players", 0, 0, 32, "int");

	//***************************************************************************
	// eXtreme+ map voting system
	//***************************************************************************
	level.ex_mapvote = [[level.ex_drm]]("ex_map_vote", 0, 0, 1, "int");
	if(level.ex_mapvote)
	{
		level.ex_mapvotemax = [[level.ex_drm]]("ex_map_vote_max", 10, 5, 50, "int");
		level.ex_mapvotemode = [[level.ex_drm]]("ex_map_vote_mode", 0, 0, 3, "int");
		level.ex_mapvotetime = [[level.ex_drm]]("ex_map_vote_time", 30, 10, 180, "int");
		level.ex_mapvotereplay = [[level.ex_drm]]("ex_map_vote_replay", 0, 0, 1, "int");
		level.ex_ignore_clanvoting = [[level.ex_drm]]("ex_ignore_clanvoting", 0, 0, 1, "int");
	}
	else level.ex_mapvotemode = 0;

	//****************************************************************************
	// eXtreme+ message of the day
	//****************************************************************************
	level.ex_motdrotate = [[level.ex_drm]]("ex_motd_rotate", 0, 0, 1, "int");
	level.ex_motdrotdelay = [[level.ex_drm]]("ex_motd_delay", 5, 5, 60, "int");

	//****************************************************************************
	// eXtreme+ spawn protection
	//****************************************************************************
	level.ex_spwn_time = [[level.ex_drm]]("ex_protection_time", 0, 0, 60, "int");
	level.ex_spwn_range = [[level.ex_drm]]("ex_protection_range", 10, 0, 800, "int") * 12;
	level.ex_spwn_hud = [[level.ex_drm]]("ex_protection_hud", 0, 0, 1, "int");
	level.ex_spwn_headicon = [[level.ex_drm]]("ex_protection_headicon", 0, 0, 1, "int");
	level.ex_spwn_punish_self = [[level.ex_drm]]("ex_protection_punish_self",0,0,1,"int");
	level.ex_spwn_punish_attacker = [[level.ex_drm]]("ex_protection_punish_attacker",0,0,1,"int");
	level.ex_spwn_wepdisable = [[level.ex_drm]]("ex_protection_weapon_disable",0,0,1,"int");
	level.ex_spwn_invisible = [[level.ex_drm]]("ex_protection_invisible",0,0,1,"int");

	level.ex_spwn_msg = [[level.ex_drm]]("ex_protection_msg",0,0,2,"int");

	if(level.ex_spwn_time) game["headicon_protect"] = "gfx/hud/hud@spprot_cross.tga";

	//****************************************************************************
	// eXtreme+ server message system
	//****************************************************************************
	level.ex_svrmsg = [[level.ex_drm]]("ex_svrmsg", 0, 0, 10, "int");
	level.ex_svrmsg_loop = [[level.ex_drm]]("ex_svrmsg_loop", 0, 0, 1, "int");
	level.ex_svrmsg_delay_msg = [[level.ex_drm]]("ex_svrmsg_delay_msg", 30, 1, 60, "int");
	level.ex_svrmsg_delay_main = [[level.ex_drm]]("ex_svrmsg_delay_main", 60, 60, 900, "int");
	level.ex_svrmsg_info = [[level.ex_drm]]("ex_svrmsg_info", 0, 0, 3, "int");
	level.ex_svrmsg_rotation = [[level.ex_drm]]("ex_svrmsg_rotation", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ active server rules
	//****************************************************************************
	level.ex_svrrules = [[level.ex_drm]]("ex_svrrules", "", "" , "", "string");

	//****************************************************************************
	// eXtreme+ hitblip
	//****************************************************************************
	level.ex_codhitblip = [[level.ex_drm]]("ex_codhitblip",0,0,1,"int");

	//****************************************************************************
	// eXtreme+ clan confiuration - set clan name, voting status and announce status
	//****************************************************************************
	level.ex_cltag = [];
	level.ex_clvote = [];
	level.ex_clano = [];
	
	level.ex_cltag[1] = [[level.ex_drm]]("ex_clantag1", "clantag1", "" , "", "string");
	level.ex_clvote[1] = [[level.ex_drm]]("ex_clantag1_vote",1,0,1, "int");
	level.ex_clano[1] = [[level.ex_drm]]("ex_clantag1_announce",1,0,1, "int");

	level.ex_cltag[2] = [[level.ex_drm]]("ex_clantag2", "clantag2", "" , "", "string");
	level.ex_clvote[2] = [[level.ex_drm]]("ex_clantag2_vote",1,0,1, "int");
	level.ex_clano[2] = [[level.ex_drm]]("ex_clantag2_announce",1,0,1, "int");
	
	level.ex_cltag[3] = [[level.ex_drm]]("ex_clantag3", "clantag3", "" , "", "string");
	level.ex_clvote[3] = [[level.ex_drm]]("ex_clantag3_vote",1,0,1, "int");
	level.ex_clano[3] = [[level.ex_drm]]("ex_clantag3_announce",1,0,1, "int");
	
	level.ex_cltag[4] = [[level.ex_drm]]("ex_clantag4", "clantag4", "" , "", "string");
	level.ex_clvote[4] = [[level.ex_drm]]("ex_clantag4_vote",1,0,1, "int");
	level.ex_clano[4] = [[level.ex_drm]]("ex_clantag4_announce",1,0,1, "int");

	// clan voting
	level.ex_clanvoting = [[level.ex_drm]]("ex_clanvoting", 0, 0, 1, "int");

	// clan voting ensure voting is enabled
	if(level.ex_clanvoting) setCvar("g_allowvote", 1);

	// Clan member welcome messages
	level.ex_clanwelcome = [[level.ex_drm]]("ex_clanwelcome", 0, 0, 1, "int");
	level.ex_clandelay = [[level.ex_drm]]("ex_clanmsgdelay", 1, 0.05, 10, "float");

	level.ex_clan1msg = [[level.ex_drm]]("ex_clan1msg", 0, 0, 3, "int");
	level.ex_clan2msg = [[level.ex_drm]]("ex_clan2msg", 0, 0, 3, "int");
	level.ex_clan3msg = [[level.ex_drm]]("ex_clan3msg", 0, 0, 3, "int");
	level.ex_clan4msg = [[level.ex_drm]]("ex_clan4msg", 0, 0, 3, "int");

	//****************************************************************************
	// eXtreme+ non clan confiuration - player welcome
	//****************************************************************************
	level.ex_pwelcome = [[level.ex_drm]]("ex_pwelcome", 0, 0, 1, "int");
	level.ex_pweldelay = [[level.ex_drm]]("ex_pwelcome_delay", 1, 0, 10, "int");
	level.ex_pwelmsg = [[level.ex_drm]]("ex_pwelcome_msg", 0, 0, 3, "int");

	//****************************************************************************
	// eXtreme+ fall damage
	//****************************************************************************
	if([[level.ex_drm]]("ex_falldamage_enable",0,0,1,"int"))
	{
		setcvar("bg_fallDamageMaxHeight", drm_getcvarint("ex_falldamage_max")*12);
		setcvar("bg_fallDamageMinHeight", drm_getcvarint("ex_falldamage_min")*12);
	}

	//****************************************************************************
	// eXtreme+ hud text and settings
	//****************************************************************************
	// Mod Info (bottom-right corner)
	level.ex_clantext = [[level.ex_drm]]("ex_clan_txt",1,0,1,"int");
	level.ex_modtext = [[level.ex_drm]]("ex_mod_txt",1,0,1,"int");

	// Clan logotxt (bottom-right corner)
	if(level.ex_clantext) thread scriptdata\_ex_clanlogo::logo();

	// Initialize custom clan logo varaiables (mylogo)
	thread extreme\_ex_mylogo::init();

	//****************************************************************************
	// eXtreme+ team killer detection - SINBIN
	//****************************************************************************
	level.ex_sinbin = [[level.ex_drm]]("ex_tksystem", 0, 0, 1, "int");
	level.ex_sinbinmaxtk = [[level.ex_drm]]("ex_tkmax", 1, 1, 10, "int");
	level.ex_sinfrztime = [[level.ex_drm]]("ex_tktime", 5, 1, 60, "int");
	level.ex_sinbinmsg = [[level.ex_drm]]("ex_tkmsg", 0, 0, 2, "int");

	//****************************************************************************
	// eXtreme+ map rotation control
	//****************************************************************************
	level.ex_pbrotate = [[level.ex_cvardef]]("ex_pbrotate", 0, 0, 1, "int");
	level.ex_pbrsmall = [[level.ex_cvardef]]("ex_pbrsmall", 0, 0, 64, "int");
	level.ex_pbrmedium = [[level.ex_cvardef]]("ex_pbrmedium", 0, 0, 64, "int");

	// Rotate map if server is empty?
	if(!isdefined(game["ex_emptytime"])) game["ex_emptytime"] = 0;
	level.ex_rotateifempty = [[level.ex_cvardef]]("ex_rotate_if_empty", 15, 0, 1440, "int");

	//****************************************************************************
	// eXtreme+ laserdot
	//****************************************************************************
	level.ex_laserdot = [[level.ex_drm]]("ex_laserdot", 0, 0, 3, "int");
	if(level.ex_laserdot)
	{
		level.ex_laserdotsize = [[level.ex_drm]]("ex_laserdot_size", 2, 1, 10, "int");
		level.ex_laserdotred = [[level.ex_drm]]("ex_laserdot_red", 1, 0, 1, "float");
		level.ex_laserdotgreen = [[level.ex_drm]]("ex_laserdot_green", 0, 0, 1, "float");
		level.ex_laserdotblue = [[level.ex_drm]]("ex_laserdot_blue", 0, 0, 1, "float");
	}

	//****************************************************************************
	// eXtreme+ killing spree and obituary system
	//****************************************************************************
 	level.ex_obrange = [[level.ex_drm]]("ex_obitunit", 1, 0, 1, "int");
 	level.ex_obituary = [[level.ex_drm]]("ex_obituary", 0, 0, 8, "int");
 	level.ex_mononame = [[level.ex_drm]]("ex_mononame", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ pain and death sounds
	//****************************************************************************
	level.ex_hitsound = [[level.ex_drm]]("ex_hitsound", 0, 0, 1, "int");
	level.ex_painsound = [[level.ex_drm]]("ex_painsound", 1, 0, 1, "int");
	level.ex_deathsound = [[level.ex_drm]]("ex_deathsound", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ realism options
	//****************************************************************************
	level.ex_droponarmhit = [[level.ex_drm]]("ex_droponarmhit", 0, 0, 100, "int");
	level.ex_droponhandhit = [[level.ex_drm]]("ex_droponhandhit", 0, 0, 100, "int");
	level.ex_triponleghit = [[level.ex_drm]]("ex_triponleghit", 0, 0, 100, "int");
	level.ex_triponfoothit = [[level.ex_drm]]("ex_triponfoothit", 0, 0, 100, "int");

	//****************************************************************************
	// eXtreme+ health/firstaid system
	//****************************************************************************
	level.ex_callformedic = [[level.ex_drm]]("ex_callformedic", 0, 0, 2, "int");
	level.ex_showinjp = [[level.ex_drm]]("ex_showinjp", 0, 0, 1, "int");
	level.ex_showinjptime = [[level.ex_drm]]("ex_showinjptime", 5, 3, 60, "float");
	level.ex_medicall = [[level.ex_drm]]("ex_medicall", 80, 0, 100, "float");
	level.ex_minheal = [[level.ex_drm]]("ex_minheal", 40, 1, 99, "int");
	level.ex_maxheal = [[level.ex_drm]]("ex_maxheal", level.ex_minheal + 1, level.ex_minheal + 1, 100, "int");
	level.ex_revokeonth = [[level.ex_drm]]("ex_revokeonth", 30, 0, 60, "int");
	level.ex_medicself = [[level.ex_drm]]("ex_medicself", 0, 0, 1, "int");
	level.ex_firstaidkits = [[level.ex_drm]]("ex_firstaidkits", 0, 0, 9, "int");
	level.ex_firstaid_random = [[level.ex_drm]]("ex_firstaid_random", 0, 0, 1, "int");
	level.ex_firstaidmsg = [[level.ex_drm]]("ex_firstaidmsg", 0, 0, 2, "int");
	level.ex_firstaidkitmsg = [[level.ex_drm]]("ex_firstaidkitmsg", 0, 0, 1, "int");
	level.ex_firstaidpickup = [[level.ex_drm]]("ex_firstaidpickup", 0, 0, 9, "int");
	
	if(level.ex_callformedic >= 1)
	{
		// Firstaid icon
		game["firstaidicon"] = "gfx/hud/hud@health_cross.tga";
	}

	// healthbar ( turns off health regen system )
	level.ex_healthbar = [[level.ex_drm]]("ex_healthbar", 0, 0, 2, "int");
	level.ex_drophealth = [[level.ex_drm]]("ex_drophealth", 0, 0, 1, "int");

	// if using the stock COD2 health system turn off the bleeding sounds, and set regen variables
	if((!level.ex_healthbar || level.ex_healthbar == 2) && level.ex_bleeding)
	{
		level.healthOverlayCutoff = [[level.ex_drm]]("ex_showinjptime", 0.35, 0, 1, "float");
		level.playerHealth_RegularRegenDelay = [[level.ex_drm]]("ex_hregendelay", 5000, 0, 99999, "int");
		level.ex_bleedsound = false;
	}

	// set up drophealth arrays
	if(level.ex_drophealth)
	{
		game["ex_healthqueue"] = [];
		game["ex_healthqueuecurrent"] = 0;

		// Set up object queues
		level.ex_objectQ["health"] = [];
		level.ex_objectQcurrent["health"] = 0;
		level.ex_objectQsize["health"] = 4;
	}

	//****************************************************************************
	// eXtreme+ anti-camper system
	//****************************************************************************
	level.ex_campwarntime = [[level.ex_drm]]("ex_campwarntime", 0, 0, 300, "int");
	level.ex_campobjtime = [[level.ex_drm]]("ex_campobjtime", level.ex_campwarntime+10, level.ex_campwarntime+5, 600, "int");
	level.ex_camptimer = [[level.ex_drm]]("ex_camptimer", 20, 0, 300, "int");
	level.ex_campsniper_warntime = [[level.ex_drm]]("ex_campsniper_warntime", 0, 0, 600, "int");
	level.ex_campsniper_objtime = [[level.ex_drm]]("ex_campsniper_objtime", level.ex_campsniper_warntime+10, level.ex_campsniper_warntime+5, 1200, "int");
	level.ex_camppunish = [[level.ex_drm]]("ex_camp_punish", 0, 0, 5, "int");

	//****************************************************************************
	// eXtreme+ weapon system
	//****************************************************************************
	// all weapons for all teams
	level.ex_all_weapons = [[level.ex_drm]]("ex_all_weapons", 0, 0, 1, "int");

	// frag grenade loadout option
	level.ex_frag_loadout = [[level.ex_drm]]("ex_frag_loadout", 0, 0, 3, "int");

	// option 0 - stock weapon based ammo frag grenades
	level.ex_wepo_frag_stock_sniper = [[level.ex_drm]]("ex_wepo_frag_stock_sniper", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_rifle = [[level.ex_drm]]("ex_wepo_frag_stock_rifle", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_mg = [[level.ex_drm]]("ex_wepo_frag_stock_mg", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_smg = [[level.ex_drm]]("ex_wepo_frag_stock_smg", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_shot = [[level.ex_drm]]("ex_wepo_frag_stock_shot", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_rl = [[level.ex_drm]]("ex_wepo_frag_stock_rl", 2, 0, 999, "int");
	level.ex_wepo_frag_stock_ft = [[level.ex_drm]]("ex_wepo_frag_stock_ft", 2, 0, 999, "int");

	// option 1 - fixed ammo frag grenades
	level.ex_wepo_frag = [[level.ex_drm]]("ex_wepo_frag", 1, 0, 999, "int");

	// option 2 - random ammo frag grenades
	level.ex_wepo_frag_random = [[level.ex_drm]]("ex_wepo_frag_random", 0, 0, 999, "int");

	// smoke grenade loadout option
	level.ex_smoke_loadout = [[level.ex_drm]]("ex_smoke_loadout", 0, 0, 3, "int");

	// option 0 - stock weapon based ammo smoke grenades
	level.ex_wepo_smoke_stock_sniper = [[level.ex_drm]]("ex_wepo_smoke_stock_sniper", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_rifle = [[level.ex_drm]]("ex_wepo_smoke_stock_rifle", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_mg = [[level.ex_drm]]("ex_wepo_smoke_stock_mg", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_smg = [[level.ex_drm]]("ex_wepo_smoke_stock_smg", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_shot = [[level.ex_drm]]("ex_wepo_smoke_stock_shot", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_rl = [[level.ex_drm]]("ex_wepo_smoke_stock_rl", 1, 0, 999, "int");
	level.ex_wepo_smoke_stock_ft = [[level.ex_drm]]("ex_wepo_smoke_stock_ft", 1, 0, 999, "int");

	// option 1 - fixed ammo smoke grenades
	level.ex_wepo_smoke = [[level.ex_drm]]("ex_wepo_smoke", 1, 0, 999, "int");

	// option 2 - random ammo smoke grenades
	level.ex_wepo_smoke_random = [[level.ex_drm]]("ex_wepo_smoke_random", 0, 0, 999, "int");

	// weapon class overides
	// 0 = all weapons
	// 1 = pistols only
	// 2 = sniper only
	// 3 = machine gun only
	// 4 = submachine gun only
	// 5 = rifles only
	// 6 = bolt action only
	// 7 = shotgun only
	// 8 = panzerschreck only
	level.ex_wepo_class = [[level.ex_drm]]("ex_wepo_class", 0, 0, 8, "int");
	
	// only class all weapons or team based weapons available
	level.ex_wepo_team_only = [[level.ex_drm]]("ex_wepo_team_only", 0, 0, 1, "int");

	// weapons limiter
	level.ex_wepo_limiter = [[level.ex_drm]]("ex_weaponlimit", 0, 0, 1, "int");

	// grenades with weapon class
	level.ex_wepo_allow_grenades = [[level.ex_drm]]("ex_wepo_allow_grenades", 0, 0, 3, "int");

	// set the grenades up for weapon class only
	if(level.ex_wepo_allow_grenades == 1)
	{
		level.ex_wepo_allow_frag = true;
		level.ex_wepo_allow_smoke = false;
	}
	else if(level.ex_wepo_allow_grenades == 2)
	{
		level.ex_wepo_allow_frag = false;
		level.ex_wepo_allow_smoke = true;
	}
	else if(level.ex_wepo_allow_grenades == 3)
	{
		level.ex_wepo_allow_frag = true;
		level.ex_wepo_allow_smoke = true;
	}
	else
	{
		level.ex_wepo_allow_frag = false;
		level.ex_wepo_allow_smoke = false;
	}

	// allow pistol sidearm
	level.ex_wepo_sidearm = [[level.ex_drm]]("ex_wepo_sidearm", 0, 0, 2, "int");

	// weapon enemy options
	level.ex_wepo_enemy = [[level.ex_drm]]("ex_wepo_enemy", 0, 0, 2, "int");
	level.ex_wepo_cent = [[level.ex_drm]]("ex_wepo_cent", 50, 0, 100, "int");

	// weapon loadout option
	level.ex_wepo_loadout = [[level.ex_drm]]("ex_wepo_loadout", 0, 0, 1, "int");
	if(level.ex_ranksystem == 0) level.ex_wepo_loadout = 0;

	//****************************************************************************
	// eXtreme+ weapon drop system (after death)
	//****************************************************************************
	// drop weapons
	level.ex_wepo_drop_weps = [[level.ex_drm]]("ex_wepo_drop_weps", 0, 0, 4, "int");

	// drop grenades
	level.ex_wepo_drop_grenades = [[level.ex_drm]]("ex_wepo_drop_grenades", 0, 0, 3, "int");

	// set up drop grenades
	if(level.ex_wepo_drop_grenades == 1)
	{
		level.ex_wepo_drop_frag = true;
		level.ex_wepo_drop_smoke = false;
	}
	else if(level.ex_wepo_drop_grenades == 2)
	{
		level.ex_wepo_drop_frag = false;
		level.ex_wepo_drop_smoke = true;
	}
	else if(level.ex_wepo_drop_grenades == 3)
	{
		level.ex_wepo_drop_frag = true;
		level.ex_wepo_drop_smoke = true;
	}
	else
	{
		level.ex_wepo_drop_frag = false;
		level.ex_wepo_drop_smoke = false;
	}

	//****************************************************************************
	// eXtreme+ secondary weapons system
	//****************************************************************************
	level.ex_wepo_secondary = [[level.ex_drm]]("ex_wepo_secondary", 0, 0, 2, "int");

	if(level.ex_wepo_secondary == 2) level.ex_wepo_sec_enemy = true;
	else level.ex_wepo_sec_enemy = false;

	// set the secondary pistol system from the sidearm settings
	if(level.ex_wepo_sidearm == 1) level.ex_wepo_sec_pistols = true;
	else level.ex_wepo_sec_pistols = false;

	//****************************************************************************
	// eXtreme+ landmines
	//****************************************************************************
	level.ex_landmines = [[level.ex_drm]]("ex_landmines", 1, 0, 1, "int");
	level.ex_landmines_loadout = [[level.ex_drm]]("ex_landmines_loadout", 1, 0, 1, "int");
	level.ex_landmines_max = [[level.ex_drm]]("ex_landmines_max", 5, 1, 32, "int");
	level.ex_landmines_fifo = [[level.ex_drm]]("ex_landmines_fifo", 1, 0, 1, "int");
	level.ex_landmine_plant_time = [[level.ex_drm]]("ex_landmine_plant_time", 5, 3, 20, "int");
	level.ex_landmine_defuse_time = [[level.ex_drm]]("ex_landmine_defuse_time", 5, 3, 20, "int");
	level.ex_landmine_warning = [[level.ex_drm]]("ex_landmine_warning", 1, 0, 1, "int");
	level.ex_landmine_depth = [[level.ex_drm]]("ex_landmine_depth", 2, 1, 2, "int");
	level.ex_landmine_ownersafe = [[level.ex_drm]]("ex_landmine_ownersafe", 1, 0, 1, "int");
	level.ex_landmine_teamsafe = [[level.ex_drm]]("ex_landmine_teamsafe", 1, 0, 1, "int");
	level.ex_landmine_surfacecheck = [[level.ex_drm]]("ex_landmine_surfacecheck", 0, 0, 1, "int");
	level.ex_allow_mine_sniper = [[level.ex_drm]]("ex_allow_mine_sniper", 2, 0, 9, "int");
	level.ex_allow_mine_boltrifle = [[level.ex_drm]]("ex_allow_mine_boltrifle", 2, 0, 9, "int");
	level.ex_allow_mine_rifle = [[level.ex_drm]]("ex_allow_mine_rifle", 2, 0, 9, "int");
	level.ex_allow_mine_semiauto = [[level.ex_drm]]("ex_allow_mine_semiauto", 2, 0, 9, "int");
	level.ex_allow_mine_smg = [[level.ex_drm]]("ex_allow_mine_smg", 2, 0, 9, "int");
	level.ex_allow_mine_mg = [[level.ex_drm]]("ex_allow_mine_mg", 2, 0, 9, "int");
	level.ex_allow_mine_shotgun = [[level.ex_drm]]("ex_allow_mine_shotgun", 2, 0, 9, "int");

	//****************************************************************************
	// eXtreme+ flamethrower
	//****************************************************************************
	level.ex_ft_tank_explode = [[level.ex_drm]]("ex_ft_tank_explode", 50, 0, 100, "int");

	//****************************************************************************
	// eXtreme+ weapons system overrides
	//****************************************************************************
	// allow use of enemy weapons if using secondary enemy menu
	if(level.ex_wepo_sec_enemy) level.ex_wepo_enemy = false;

	// if weapon class based overrides
	if(level.ex_wepo_class)
	{
		// disable the secondary weapons sytem
		level.ex_wepo_secondary = false;

		// disable the weapon limiter
		level.ex_wepo_limiter = false;

		// override team only menu if bolt action or shotgun is the weapon class
		if(level.ex_wepo_class >= 6) level.ex_wepo_team_only = false;

		// allow use of enemy weapons if not team based
		if(!level.ex_wepo_team_only) level.ex_wepo_enemy = false;
	}

	// if the rank system is disabled, use default weapon, frag and smoke ammo settings
	if(!level.ex_ranksystem)
	{
		// set weapon ammo loadout to stock
		if(level.ex_wepo_loadout == 1) level.ex_wepo_loadout = 0;

		// set frag ammo loadout to stock
		if(level.ex_frag_loadout == 1) level.ex_frag_loadout = 0;

		// set smoke ammo loadout to stock
		if(level.ex_smoke_loadout == 1) level.ex_smoke_loadout = 0;

		// set landmines ammo loadout to stock
		if(level.ex_landmines_loadout == 1) level.ex_landmines_loadout = 0;
	}

	//****************************************************************************
	// eXtreme+ forced clientside dvars
	//****************************************************************************
	level.ex_forceclientdvars = [[level.ex_drm]]("ex_forceclientdvars", 0, 0, 1, "int");
	level.ex_forcerate = [[level.ex_drm]]("ex_forcerate", 25000, 0, 99999, "int");
	level.ex_mantlehint = [[level.ex_drm]]("ex_mantlehint", 1, 0, 1, "int");
	level.ex_crosshair = [[level.ex_drm]]("ex_crosshair", 1, 0, 1, "int");
	level.ex_crosshairnames = [[level.ex_drm]]("ex_crosshairnames", 1, 0, 1, "int");
	level.ex_enemycross = [[level.ex_drm]]("ex_enemycross", 1, 0, 1, "int");
	level.ex_hudstance = [[level.ex_drm]]("ex_hudstance", 1, 0, 1, "int");
	level.ex_brightmodels = [[level.ex_drm]]("ex_brightmodels", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ unknown soldier handling system
	//****************************************************************************
	level.ex_uscheck = [[level.ex_drm]]("ex_uscheck", 1, 0, 1, "int");
	level.ex_usclanguest = [[level.ex_drm]]("ex_usclanguest", 0, 0, 1, "int");
	level.ex_usclanguestname = [[level.ex_drm]]("ex_usclanguestname", "Guest#", "" , "", "string");
	level.ex_usguestname = [[level.ex_drm]]("ex_usguestname", "UnacceptableName#", "" , "", "string");
	level.ex_uswarndelay1 = [[level.ex_drm]]("ex_uswarndelay1", 30, 20, 60, "int");
	level.ex_uswarndelay2 = [[level.ex_drm]]("ex_uswarndelay2", 30, 20, 120, "int");
	level.ex_uspunishcount = [[level.ex_drm]]("ex_uspunishcount", 5, 1, 999, "int");

	//****************************************************************************
	// eXtreme+ sprint system
	//****************************************************************************
	level.ex_sprint = [[level.ex_drm]]("ex_sprint",0,0,3,"int");
	level.ex_sprinttime = [[level.ex_drm]]("ex_sprint_time",3,1,999,"int") * 20;
	level.ex_sprintrecovertime = [[level.ex_drm]]("ex_sprint_recover_time",2,1,999,"int") * 20;
	level.ex_sprinthud = [[level.ex_drm]]("ex_sprint_hud",1,0,1,"int");
	level.ex_sprinthudhint = [[level.ex_drm]]("ex_sprint_hud_hint",0,0,1,"int");
	level.ex_sprintheavyflag = [[level.ex_drm]]("ex_sprint_heavy_flag",0,0,1,"int");
	level.ex_sprintheavymg = [[level.ex_drm]]("ex_sprint_heavy_mg",1,0,1,"int");
	level.ex_sprintheavypanzer = [[level.ex_drm]]("ex_sprint_heavy_panzer",1,0,1,"int");

	//****************************************************************************
	// eXtreme+ gravity and game speed overrides
	//****************************************************************************
	if([[level.ex_drm]]("ex_gravity",100,0,9999,"int") != 100) setcvar("g_gravity", 8 * [[level.ex_drm]]("ex_gravity",100,0,9999,"int"));
	if([[level.ex_drm]]("ex_speed",100,0,9999,"int") != 100) setcvar("g_speed", int(1.9 * [[level.ex_drm]]("ex_speed",100,0,9999,"int")) );

	//****************************************************************************
	// eXtreme+ player stats
	//****************************************************************************
	extreme\_ex_statshud::init();
	// if player stats and safe mode enabled, disable certain features to free up HUD elements
	if(level.ex_statshud && level.ex_statshud_safemode)
	{
		level.ex_logopic = 0;
		level.ex_livestats = 0;
		level.ex_sprinthud = 0;
		level.ex_sprinthudhint = 0;
	}

	//****************************************************************************
	// eXtreme+ statsboard
	//****************************************************************************
	level.ex_stbd = [[level.ex_drm]]("ex_stbd",0,0,1,"int");
	if(level.ex_stbd)
	{
		level.ex_stbd_kd = [[level.ex_drm]]("ex_stbd_kd", 1, 0, 1, "int");
		level.ex_stbd_se = [[level.ex_drm]]("ex_stbd_se", 1, 0, 1, "int");
		level.ex_stbd_tps = [[level.ex_drm]]("ex_stbd_tps", 0, 0, 10, "int");
		level.ex_stbd_time = [[level.ex_drm]]("ex_stbd_time", 20, 0, 120, "int");
		level.ex_stbd_icons = [[level.ex_drm]]("ex_stbd_icons", 0, 0, 1, "int");
		level.ex_stbd_movex = [[level.ex_drm]]("ex_stbd_movex", 0, 0, 150, "int");
		level.ex_stbd_fade = [[level.ex_drm]]("ex_stbd_fade", 0, 0, 1, "int");
		level.ex_stbd_log = [[level.ex_drm]]("ex_stbd_log", 0, 0, 1, "int");
		if(!level.ex_stbd_kd && !level.ex_stbd_se) level.ex_stbd = 0;
	}

	//****************************************************************************
	// eXtreme+ ambient planes
	//****************************************************************************
	level.ex_planes = [[level.ex_drm]]("ex_planes", 0, 0, 3, "int");
	level.ex_planes_min = [[level.ex_drm]]("ex_planes_min", 1, 1, 19, "int");
	level.ex_planes_max = [[level.ex_drm]]("ex_planes_max", level.ex_planes_min + 1, level.ex_planes_min + 1, 20, "int");
	level.ex_planes_delay_min = [[level.ex_drm]]("ex_planes_delay_min", 60, 30, 720, "int");
	level.ex_planes_delay_max = [[level.ex_drm]]("ex_planes_delay_max", level.ex_planes_delay_min + 1, level.ex_planes_delay_min + 1, 1440, "int");
	level.ex_planes_flak = [[level.ex_drm]]("ex_planes_flak", 0, 0, 1, "int");
	level.ex_planes_altitude = [[level.ex_drm]]("ex_planes_altitude", 6000, 0, 6000, "int");

	//****************************************************************************
	// eXtreme+ ambient flares
	//****************************************************************************
	level.ex_flares = [[level.ex_drm]]("ex_flares", 0, 0, 1, "int");
	level.ex_flare_type = [[level.ex_drm]]("ex_flare_type", 0, 0, 1, "int");
	level.ex_flare_alert = [[level.ex_drm]]("ex_flare_alert", 1, 0, 1, "int");
	level.ex_flares_min = [[level.ex_drm]]("ex_flares_min", 5, 5, 15, "int");
	level.ex_flares_max = [[level.ex_drm]]("ex_flares_max", level.ex_flares_min * 2, level.ex_flares_min + 1, 30, "int");
	level.ex_flares_delay_min = [[level.ex_drm]]("ex_flares_delay_min", 300, 30, 720, "int");
	level.ex_flares_delay_max = [[level.ex_drm]]("ex_flares_delay_max", level.ex_flares_delay_min * 2, level.ex_flares_delay_min + 1, 1440, "int");
	
	//****************************************************************************
	// eXtreme+ ambient mortars
	//****************************************************************************
	level.ex_mortars = [[level.ex_drm]]("ex_mortars", 0, 0, 2, "int");
	level.ex_mortars_alert = [[level.ex_drm]]("ex_mortars_alert", 0, 0, 1, "int");
	level.ex_mortars_min = [[level.ex_drm]]("ex_mortars_min", 10, 1, 24, "int");
	level.ex_mortars_max = [[level.ex_drm]]("ex_mortars_max", level.ex_mortars_min + 1, level.ex_mortars_min + 1, 25, "int");
	level.ex_mortars_delay_min = [[level.ex_drm]]("ex_mortars_delay_min", 60, 30, 1440, "int");
	level.ex_mortars_delay_max = [[level.ex_drm]]("ex_mortars_delay_max", level.ex_mortars_delay_min + 1, level.ex_mortars_delay_min + 1, 1440, "int");

	//****************************************************************************
	// eXtreme+ ambient artillery
	//****************************************************************************
	level.ex_artillery = [[level.ex_drm]]("ex_artillery", 1, 0, 2, "int");
	level.ex_artillery_alert = [[level.ex_drm]]("ex_artillery_alert", 1, 0, 1, "int");
	level.ex_artillery_shells_min = [[level.ex_drm]]("ex_artillery_shells_min", 5, 5, 15, "int");
	level.ex_artillery_shells_max = [[level.ex_drm]]("ex_artillery_shells_max", level.ex_artillery_shells_min * 2, level.ex_artillery_shells_min + 1, 30, "int");
	level.ex_artillery_delay_min = [[level.ex_drm]]("ex_artillery_delay_min", 300, 30, 720, "int");
	level.ex_artillery_delay_max = [[level.ex_drm]]("ex_artillery_delay_max", level.ex_artillery_delay_min * 2, level.ex_artillery_delay_min + 1, 1440, "int");

	//****************************************************************************
	// eXtreme+ turrets
	//****************************************************************************
	level.ex_turrets = [[level.ex_drm]]("ex_turrets", 1, 0, 2, "int");
	if(level.ex_wepo_class != 0 && level.ex_turrets == 2) level.ex_turrets = 1;
	level.ex_turretabuse = [[level.ex_drm]]("ex_turretabuse", 0, 0, 1, "int");
	level.ex_turretabuse_warn = [[level.ex_drm]]("ex_turretabuse_warn", 5, 0, 99, "int");
	level.ex_turretabuse_kill = [[level.ex_drm]]("ex_turretabuse_kill", level.ex_turretabuse_warn+2, level.ex_turretabuse_warn+1, 100, "int");
	if(!level.ex_turrets)
	{
		extreme\_ex_utils::deletePlacedEntity("misc_turret");
		extreme\_ex_utils::deletePlacedEntity("misc_mg42");
	}

	//****************************************************************************
	// eXtreme+ heavy MG's
	//****************************************************************************
	level.ex_mg_shoot_disable = [[level.ex_drm]]("ex_mg_shoot_disable", 0, 0, 1, "int");
	level.ex_mg_shoot_damage = [[level.ex_drm]]("ex_mg_shoot_damage", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ sky fx
	//****************************************************************************
	// tracer fx
	level.ex_tracers = [[level.ex_drm]]("ex_tracers", 0, 0, 10, "int");

	if(level.ex_tracers)
	{
		level.ex_tracersdelaymin = [[level.ex_drm]]("ex_tracers_delay_min", 10, 5, 720, "int");
		level.ex_tracersdelaymax = [[level.ex_drm]]("ex_tracers_delay_max", level.ex_tracersdelaymin + 1, level.ex_tracersdelaymin + 1, 1440, "int");
		level.ex_tracers_sound = [[level.ex_drm]]("ex_tracers_sound", 0, 0, 1, "int");
	}

	// flak fx
	level.ex_flakfx = [[level.ex_drm]]("ex_flakfx", 0, 0, 10, "int");

	if(level.ex_flakfx)
	{
		level.ex_flakfxdelaymin = [[level.ex_drm]]("ex_flakfx_delay_min", 5, 5, 720, "int");
		level.ex_flakfxdelaymax = [[level.ex_drm]]("ex_flakfx_delay_max", level.ex_flakfxdelaymin + 1, level.ex_flakfxdelaymin + 1, 1440, "int");
	}

	// flak settings if plane flak enabled
	if(level.ex_planes_flak || level.ex_ranksystem)
	{
		if(level.ex_flakfx < 10) level.ex_flak = 10;
		level.ex_flakfxdelaymin = 5;
		level.ex_flakfxdelaymax = 15;
	}

	//****************************************************************************
	// eXtreme+ pop helmet system
	//****************************************************************************
	// helmet pop
	level.ex_pophelmet = [[level.ex_drm]]("ex_pophelmet", 0, 0, 100, "int");

	if(level.ex_pophelmet)
	{
		// Set up object queues
		level.ex_objectQ["helmet"] = [];
		level.ex_objectQcurrent["helmet"] = 0;
		level.ex_objectQsize["helmet"] = 8;
	}

	//****************************************************************************
	// Special grenades
	//****************************************************************************
	level.ex_firenades = [[level.ex_drm]]("ex_fire_grenades",0,0,1,"int");
	level.ex_gasnades = [[level.ex_drm]]("ex_gas_grenades",0,0,1,"int");
	level.ex_satchelcharges = [[level.ex_drm]]("ex_satchel_charges",0,0,1,"int");

	//****************************************************************************
	// eXtreme+ coloured smoke grenades
	//****************************************************************************
	level.ex_smoke["american"] = [[level.ex_drm]]("ex_american_smoke", 0, 0, 9, "int");
	level.ex_smoke["british"] = [[level.ex_drm]]("ex_british_smoke", 0, 0, 9, "int");
	level.ex_smoke["russian"] = [[level.ex_drm]]("ex_russian_smoke", 0, 0, 9, "int");
	level.ex_smoke["german"] = [[level.ex_drm]]("ex_german_smoke", 0, 0, 9, "int");

	//****************************************************************************
	// eXtreme+ command monitor
	//****************************************************************************
	level.ex_cmdmonitor = [[level.ex_drm]]("ex_cmd_monitor", 0, 0, 1, "int");
	level.ex_cmdmonitor_models = [[level.ex_drm]]("ex_cmdmonitor_models", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ player model limiter
	//****************************************************************************
	level.ex_american_normandy = [[level.ex_drm]]("ex_american_normandy", 10, 1, 10, "int");
	level.ex_british_africa = [[level.ex_drm]]("ex_british_africa", 5, 1, 5, "int");
	level.ex_british_normandy = [[level.ex_drm]]("ex_british_africa", 6, 1, 6, "int");
	level.ex_german_winterdark = [[level.ex_drm]]("ex_german_winterdark", 2, 1, 2, "int");
	level.ex_russian_coat = [[level.ex_drm]]("ex_russian_coat",4, 1, 4, "int");
	level.ex_russian_padded = [[level.ex_drm]]("ex_russian_padded", 2, 1, 2, "int");

	//****************************************************************************
	// eXtreme+ WMD explosion control options
	//****************************************************************************
	// radius control
	level.ex_planecrash_radius = 12 * [[level.ex_drm]]("ex_planecrash_radius",0, 1, 999, "int");
	level.ex_planebomb_radius = 12 * [[level.ex_drm]]("ex_planebomb_radius",0, 1, 999, "int");
	level.ex_artillery_radius = 12 * [[level.ex_drm]]("ex_artillery_radius",0, 1, 999, "int");
	level.ex_mortar_radius = 12 * [[level.ex_drm]]("ex_mortar_radius",0, 1, 999, "int");

	//****************************************************************************
	// eXtreme + ammo crates
	//****************************************************************************
	level.ex_amc_perteam = [[level.ex_drm]]("ex_amc_perteam", 0, 0, 8, "int");
	level.ex_amc_msg = [[level.ex_drm]]("ex_amc_msg", 0, 0, 3, "int");
	level.ex_amc_compass = [[level.ex_drm]]("ex_amc_compass", 0, 0, 2, "int");
	level.ex_amc_chutein = [[level.ex_drm]]("ex_amc_chutein", 0, 0, 3600, "int");
	level.ex_amc_chutein_slice = [[level.ex_drm]]("ex_amc_chutein_slice", 0, 0, 4, "int");
	level.ex_amc_chutein_neutral = [[level.ex_drm]]("ex_amc_chutein_neutral", 0, 0, 1, "int");
 	level.ex_amc_chutein_lifespan = [[level.ex_drm]]("ex_amc_chutein_lifespan", 0, 0, 3600, "int");
	level.ex_amc_chutein_pause_slice = [[level.ex_drm]]("ex_amc_chutein_pause_slice", 10, 1, 3600, "int");
	level.ex_amc_chutein_pause_all = [[level.ex_drm]]("ex_amc_chutein_pause_all", 240, 1, 3600, "int");
	level.ex_amc_chutein_score = [[level.ex_drm]]("ex_amc_chutein_score", 0, 0, 3, "int");

	//****************************************************************************
	// eXtreme + entities (free up entities by removing unused spawnpoints)
	//****************************************************************************
	level.ex_entities = [[level.ex_drm]]("ex_entities", 0, 0, 1, "int");
	level.ex_entities_debug = [[level.ex_drm]]("ex_entities_debug", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ post-map loadfx, precache strings, shaders, models, headicons
	//****************************************************************************
	// loadfx
	thread loadeffects();

	// precache strings
	thread preacachestrings();

	// preache headicons
	thread precacheheadicons();

	// precache rank system shaders, headicons and statusicons
	if(level.ex_ranksystem) thread precacheranksystem(); 

	// precache shaders
	thread precacheshaders();

	// precache models
	thread precachemodels();

	// precache menus
	precacheMenu("clientcmd");
	precacheMenu("stand");
	precacheMenu("prone");
	precacheMenu("crouch");

	//****************************************************************************
	// eXtreme+ end of pre-map configuration
	//****************************************************************************
}

// for variables and precaching that require team parameters
postmapload()
{
	//****************************************************************************
	// eXtreme+ serverinfo (main starting screen)
	//****************************************************************************
	thread extreme\_ex_serverinfo::main();

	//****************************************************************************
	// eXtreme+ allies & axis setup
	//****************************************************************************
	if(!isDefined(game["allies"])) game["allies"] = "american";
	if(!isDefined(game["axis"])) game["axis"] = "german";

	// server cvar overrides
	if(drm_getCvar("scr_allies") != "") game["allies"] = drm_getCvar("scr_allies");
	if(drm_getCvar("scr_axis") != "") game["axis"] = drm_getCvar("scr_axis");

	//****************************************************************************
	// eXtreme+ winter map detection and options
	//****************************************************************************
	if(isdefined(game["german_soldiertype"]) && (game["german_soldiertype"] == "winterlight" || game["german_soldiertype"] == "winterdark")) level.ex_wintermap = true;
		else level.ex_wintermap = false;

	// cold breath fx
	level.ex_coldbreathfx = [[level.ex_drm]]("ex_coldbreathfx", 0, 0, 1, "int");

	//****************************************************************************
	// eXtreme+ allies and axis headicons
	//****************************************************************************
	game["headicon_axis"] = "headicon_" + game["axis"];
	game["headicon_allies"] = "headicon_" + game["allies"];

	//****************************************************************************
	// eXtreme+ post-map loadfx, precache strings, shaders, models, headicons
	//****************************************************************************
	// postmapload preachestrings
	thread postmapload_loadfx();

	// postmapload preachestrings
	thread postmapload_precachestrings();

	// postmapload preachestrings
	thread postmapload_precacheshaders();

	//****************************************************************************
	// eXtreme+ end of post-map configuration
	//****************************************************************************
}

loadeffects()
{
	if(level.ex_turretabuse || (!level.ex_camppunish || level.ex_camppunish == 2)) level.ex_effect["blowthefag"] = loadfx("fx/explosions/matmata_plane_explosion.efx");

	if(level.ex_flares >= 1)
	{
		if(level.ex_flare_type)
			level.ex_effect["flare_ambient"] = loadfx("fx/flares/flare_1.efx");
		else
			level.ex_effect["flare_ambient"] = loadfx("fx/misc/flare_hill400.efx");
	}

	if(level.ex_flakfx >=1 || level.ex_planes_flak || level.ex_ranksystem)
	{
		// flak fx
		level.ex_effect["flak_smoke"] = loadfx("fx/explosions/flak_puff.efx");
		level.ex_effect["flak_flash"] = loadfx("fx/explosions/default_explosion.efx");
		level.ex_effect["flak_dust"] = loadfx("fx/dust/flak_dust_blowback.efx");
	}

	if(level.ex_tracers >= 1) level.ex_effect["tracer"] = loadfx("fx/misc/antiair_tracers.efx");

	if(level.ex_cmdmonitor)
	{
		level.ex_effect["barrel"] = loadfx("fx/props/barrelexp.efx");
		level.ex_effect["flesh"] = loadfx("fx/impacts/flesh_hit.efx");
	}

	// body fire effects
	if(level.ex_ranksystem || level.ex_cmdmonitor)
	{
		level.ex_effect["bodygroundfire"] = loadfx("fx/fire/ground_fire_med.efx");
		level.ex_effect["bodyarmfire"] = loadfx("fx/fire/character_arm_fire.efx");
		level.ex_effect["bodytorsofire"] = loadfx("fx/fire/character_torso_fire.efx");
	}

	if(level.ex_artillery || level.ex_cmdmonitor || level.ex_mortars || level.ex_planes || level.ex_landmines || level.ex_ranksystem)
	{
		level.ex_effect["plane_smoke"] = loadfx("fx/fire/fire_airplane_trail.efx");
		level.ex_effect["plane_explosion"] = loadfx("fx/explosions/matmata_plane_explosion.efx");
		level.ex_effect["planecrash_fire"] = loadfx("fx/fire/building_fire_med.efx");
		level.ex_effect["planecrash_smoke"] = loadfx("fx/smoke/thin_black_smoke_M.efx");
		level.ex_effect["planecrash_ball"] = loadfx("fx/smoke/battlefield_smokebank_S.efx");

		//napalm
		level.ex_effect["napalm_bomb"] = loadfx("fx/extreme_napalm/napalm.efx");

		// generic explosion effects
		level.ex_effect["explosion_beach"] = loadfx("fx/explosions/mortarExp_beach.efx");
		level.ex_effect["explosion_concrete"] = loadfx("fx/explosions/mortarExp_concrete.efx");
		level.ex_effect["explosion_dirt"] = loadfx("fx/explosions/mortarExp_dirt.efx");
		level.ex_effect["explosion_mud"] = loadfx("fx/explosions/mortarExp_mud.efx");
		level.ex_effect["explosion_water"] = loadfx("fx/explosions/mortarExp_water.efx");
		level.ex_effect["explosion_wood"] = loadfx("fx/explosions/grenadeExp_wood.efx");
		level.ex_effect["explosion_snow"] = loadfx("fx/explosions/grenadeExp_snow.efx");
		level.ex_effect["explosion_smoke"] = loadfx("fx/smoke/dark_smoke_trail.efx");

		if(level.ex_ranksystem && level.ex_rank_wmd_flare) level.ex_effect["flare_indicator"] = loadfx("fx/misc/flare_artillery_runner.efx");
	}

	if((level.ex_campwarntime || level.ex_campsniper_warntime) && (!level.ex_camppunish || level.ex_camppunish == 2)) level.ex_effect["fartbomb"] = loadfx("fx/fart/fartsmoke.efx");

	level.ex_effect["plane_bomb"] = loadfx("fx/explosions/spitfire_bomb_dirt.efx");
	level.ex_effect["artillery"] = loadfx("fx/props/barrelexp.efx");
	level.ex_effect["bleeding"] = loadfx("fx/impacts/bleeding_hit.efx");
	level.ex_effect["playerburn"] = loadfx("fx/fire/character_torso_fire.efx");
	level.ex_effect["playerburn2"] = loadfx("fx/fire/character_arm_fire.efx");
	level.ex_effect["puke"] = loadfx("fx/misc/vomit.efx");
	level.ex_effect["fire"] = loadfx("fx/impacts/molotov_blast.efx");
	level.ex_effect["gas"] = loadfx("fx/impacts/mustard_blast.efx");
	level.ex_effect["ft_fire0"] = loadfx("fx/flamethrower/ft_fire0.efx");
	level.ex_effect["ft_fire1"] = loadfx("fx/flamethrower/ft_fire1.efx");
	level.ex_effect["satchel"] = loadfx ("fx/explosions/barn_explosion.efx");
}

precacheranksystem()
{
	//Rank Definitions
	game["rank_priv_a"] = "rank_private";
	game["rank_corp_a"] = "rank_corporal";
	game["rank_serg_a"] = "rank_sergeant";
	game["rank_lieut_a"] = "rank_lieutenant";
	game["rank_capt_a"] = "rank_captain";
	game["rank_major_a"] = "rank_major";
	game["rank_colon_a"] = "rank_colonel";
	game["rank_gen_a"] = "rank_general";

	//Head Rank Definitions
	game["headicon_private_a"] = "headicon_privateA";
	game["headicon_corporal_a"] = "headicon_corpor_a";
	game["headicon_sergeant_a"] = "headicon_sergnt_a";
	game["headicon_lieutenant_a"] = "headicon_lieute_a";
	game["headicon_captain_a"] = "headicon_captan_a";
	game["headicon_major_a"] = "headicon_major0_a";
	game["headicon_colonel_a"] = "headicon_colonl_a";
	game["headicon_general_a"] = "headicon_generl_a";

	//Head Rank Precache
	[[level.ex_PrecacheHeadIcon]](game["headicon_private_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_corporal_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_sergeant_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_lieutenant_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_captain_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_major_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_colonel_a"]);
	[[level.ex_PrecacheHeadIcon]](game["headicon_general_a"]);

	//Rank Precache
	[[level.ex_PrecacheShader]](game["rank_priv_a"]);
	[[level.ex_PrecacheShader]](game["rank_corp_a"]);
	[[level.ex_PrecacheShader]](game["rank_serg_a"]);
	[[level.ex_PrecacheShader]](game["rank_lieut_a"]);
	[[level.ex_PrecacheShader]](game["rank_capt_a"]);
	[[level.ex_PrecacheShader]](game["rank_major_a"]);
	[[level.ex_PrecacheShader]](game["rank_colon_a"]);
	[[level.ex_PrecacheShader]](game["rank_gen_a"]);

	//ScoreBoard Rank Precache
	[[level.ex_PrecacheStatusIcon]](game["rank_priv_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_corp_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_serg_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_lieut_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_capt_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_major_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_colon_a"]);
	[[level.ex_PrecacheStatusIcon]](game["rank_gen_a"]);
}

preacachestrings()
{
	// Server redirection
	if(level.ex_redirect)
	{
		[[level.ex_PrecacheString]](&"REDIRECT_TITLE");
		[[level.ex_PrecacheString]](&"REDIRECT_TIMELEFT");
		[[level.ex_PrecacheString]](&"REDIRECT_REASON_ISPRIVATE");
		[[level.ex_PrecacheString]](&"REDIRECT_REASON_ISFULL");
		[[level.ex_PrecacheString]](&"REDIRECT_REASON_ISOLD");
		[[level.ex_PrecacheString]](&"REDIRECT_REASON_ISSERVICED");
		[[level.ex_PrecacheString]](&"REDIRECT_REASON_CLANPRIORITY");
		[[level.ex_PrecacheString]](&"REDIRECT_CLAN_FREEUPSLOT");
		[[level.ex_PrecacheString]](&"REDIRECT_CLAN_ABORTED");
		[[level.ex_PrecacheString]](&"REDIRECT_CLAN_PLEASEWAIT");
		[[level.ex_PrecacheString]](&"REDIRECT_CLAN_CONTINUE");
		[[level.ex_PrecacheString]](&"REDIRECT_TO_PUBLICSERVER");
		[[level.ex_PrecacheString]](&"REDIRECT_TO_OTHERSERVER");
		[[level.ex_PrecacheString]](&"REDIRECT_TO_NEWSERVER");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_REMFROMFAV");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_ADDTOFAV");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_VISITWEBSITE");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_SORRY");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_PRIORITY");
		[[level.ex_PrecacheString]](&"REDIRECT_HINT_EXTREME");
	}
	
	// round based gametype round number text
	if(level.ex_roundbased)
	{
		[[level.ex_PrecacheString]](&"WELCOME_ROUNDNUMBER");
		[[level.ex_PrecacheString]](&"WELCOME_LASTROUND");
	}

	if(level.ex_bleedmsg)
	{
		// Bleeding messages enhanced
		[[level.ex_PrecacheString]](&"BLEED_NECK");
		[[level.ex_PrecacheString]](&"BLEED_HEAD");
		[[level.ex_PrecacheString]](&"BLEED_HELMET");
		[[level.ex_PrecacheString]](&"BLEED_UPPERBODY");
		[[level.ex_PrecacheString]](&"BLEED_LOWERBODY");
		[[level.ex_PrecacheString]](&"BLEED_UPPERLEFTLEG");
		[[level.ex_PrecacheString]](&"BLEED_UPPERRIGHTLEG");
		[[level.ex_PrecacheString]](&"BLEED_LOWERLEFTLEG");
		[[level.ex_PrecacheString]](&"BLEED_LOWERRIGHTLEG");
		[[level.ex_PrecacheString]](&"BLEED_LEFTFOOT");
		[[level.ex_PrecacheString]](&"BLEED_RIGHTFOOT");
		[[level.ex_PrecacheString]](&"BLEED_UPPERLEFTARM");
		[[level.ex_PrecacheString]](&"BLEED_UPPERRIGHTARM");
		[[level.ex_PrecacheString]](&"BLEED_LOWERLEFTARM");
		[[level.ex_PrecacheString]](&"BLEED_LOWERRIGHTARM");
		[[level.ex_PrecacheString]](&"BLEED_LEFTHAND");
		[[level.ex_PrecacheString]](&"BLEED_RIGHTHAND");
		[[level.ex_PrecacheString]](&"BLEED_GRENADE_SPLASH");
		[[level.ex_PrecacheString]](&"BLEED_FALLING");
		[[level.ex_PrecacheString]](&"BLEED_ARTILLERY");
		[[level.ex_PrecacheString]](&"BLEED_MORTAR");
		[[level.ex_PrecacheString]](&"BLEED_PLANEBOMB");
		[[level.ex_PrecacheString]](&"BLEED_PLANECRASH");
		[[level.ex_PrecacheString]](&"BLEED_TRIPWIRE");
		[[level.ex_PrecacheString]](&"BLEED_GENERIC");
		[[level.ex_PrecacheString]](&"BLEED_STOPPED");
		[[level.ex_PrecacheString]](&"BLEED_EXPLOSIVE");
	}

	if(level.ex_gtsdelay)
	{
		[[level.ex_PrecacheString]](&"GTSDELAY_WAITING_PLAYERS");
		[[level.ex_PrecacheString]](&"GTSDELAY_MATCH_BEGINS");
	}		

	if(level.ex_sinbinmsg == 2 || level.ex_firstaidmsg == 2 || level.ex_spwn_msg == 2 || level.ex_bleedmsg >= 2)
	{
		[[level.ex_PrecacheString]](&"TIME_1_SECOND");
		[[level.ex_PrecacheString]](&"TIME_2_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_3_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_4_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_5_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_6_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_7_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_8_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_9_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_10_SECONDS");
		
		[[level.ex_PrecacheString]](&"TIME_11_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_12_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_13_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_14_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_15_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_16_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_17_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_18_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_19_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_20_SECONDS");
	
		[[level.ex_PrecacheString]](&"TIME_21_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_22_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_23_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_24_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_25_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_26_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_27_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_28_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_29_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_30_SECONDS");	
	
		[[level.ex_PrecacheString]](&"TIME_31_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_32_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_33_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_34_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_35_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_36_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_37_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_38_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_39_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_40_SECONDS");
	
		[[level.ex_PrecacheString]](&"TIME_41_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_42_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_43_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_44_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_45_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_46_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_47_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_48_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_49_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_50_SECONDS");
	
		[[level.ex_PrecacheString]](&"TIME_51_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_52_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_53_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_54_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_55_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_56_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_57_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_58_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_59_SECONDS");
		[[level.ex_PrecacheString]](&"TIME_60_SECONDS");
	}

	if(level.ex_stbd)
	{
		//Statsboard title
		[[level.ex_PrecacheString]](&"STATSBOARD_TITLE");
		[[level.ex_PrecacheString]](&"STATSBOARD_HOWTO");
		[[level.ex_PrecacheString]](&"STATSBOARD_TIMELEFT");
		[[level.ex_PrecacheString]](&"STATSBOARD_PLAYERLEFT");

		//Statsboard kills and deaths categories
		if(level.ex_stbd_kd)
		{
			[[level.ex_PrecacheString]](&"STATSBOARD_HEADER_KD");
			[[level.ex_PrecacheString]](&"STATSBOARD_KILLS_DEATHS");
			[[level.ex_PrecacheString]](&"STATSBOARD_GRENADES");
			[[level.ex_PrecacheString]](&"STATSBOARD_TRIPWIRES");
			[[level.ex_PrecacheString]](&"STATSBOARD_HEADSHOTS");
			[[level.ex_PrecacheString]](&"STATSBOARD_BASHES");
			[[level.ex_PrecacheString]](&"STATSBOARD_SNIPERS");
			[[level.ex_PrecacheString]](&"STATSBOARD_KNIVES");
			[[level.ex_PrecacheString]](&"STATSBOARD_MORTARS");
			[[level.ex_PrecacheString]](&"STATSBOARD_ARTILLERY");
			[[level.ex_PrecacheString]](&"STATSBOARD_AIRSTRIKES");
			[[level.ex_PrecacheString]](&"STATSBOARD_NAPALM");
			[[level.ex_PrecacheString]](&"STATSBOARD_PANZERS");
			[[level.ex_PrecacheString]](&"STATSBOARD_LANDMINES");
			[[level.ex_PrecacheString]](&"STATSBOARD_FIRENADES");
			[[level.ex_PrecacheString]](&"STATSBOARD_GASNADES");
			[[level.ex_PrecacheString]](&"STATSBOARD_FLAMETHROWERS");
			[[level.ex_PrecacheString]](&"STATSBOARD_SATCHELCHARGES");
			[[level.ex_PrecacheString]](&"STATSBOARD_SPAM_KILLS");
			[[level.ex_PrecacheString]](&"STATSBOARD_TEAM_KILLS");
			[[level.ex_PrecacheString]](&"STATSBOARD_PLANE_DEATHS");
			[[level.ex_PrecacheString]](&"STATSBOARD_FALLING_DEATHS");
			[[level.ex_PrecacheString]](&"STATSBOARD_MINEFIELD_DEATHS");
			[[level.ex_PrecacheString]](&"STATSBOARD_SUICIDE_DEATHS");
			[[level.ex_PrecacheString]](&"STATSBOARD_SPAWN");
		}

		//Statsboard score, efficiency and bonus points
		if(level.ex_stbd_se)
		{
			[[level.ex_PrecacheString]](&"STATSBOARD_HEADER_SE");
			[[level.ex_PrecacheString]](&"STATSBOARD_SCORE_EFFICIENCY");
			[[level.ex_PrecacheString]](&"STATSBOARD_HEADER_BP");
			[[level.ex_PrecacheString]](&"STATSBOARD_BONUS");
		}
	}

	// sprint
	if(level.ex_sprint)
	{
		[[level.ex_PrecacheString]](&"SPRINT_HINT");
	}

	if(level.ex_ranksystem)
	{
		[[level.ex_PrecacheString]](&"WMD_MORTAR_HINT");
		[[level.ex_PrecacheString]](&"WMD_ARTILLERY_HINT");
		[[level.ex_PrecacheString]](&"WMD_AIRSTRIKE_HINT");
		[[level.ex_PrecacheString]](&"WMD_NAPALM_HINT");
		[[level.ex_PrecacheString]](&"WMD_ACTIVATE_HINT");
		
	}

	if(level.ex_callformedic)
	{
		[[level.ex_PrecacheString]](&"FIRSTAID_MEDI");
		[[level.ex_PrecacheString]](&"FIRSTAID_DISABLED");
	}

	// Tripwire messages
	if(level.ex_tweapon)
	{
		[[level.ex_PrecacheString]](&"TRIPWIRE_CHOOSE_GRENADE");
		[[level.ex_PrecacheString]](&"TRIPWIRE_FRAG_HOLD_SMOKE");
		[[level.ex_PrecacheString]](&"TRIPWIRE_SMOKE_HOLD_CANCEL");
		[[level.ex_PrecacheString]](&"TRIPWIRE_DEFUSE");
		[[level.ex_PrecacheString]](&"TRIPWIRE_PLANT");
		[[level.ex_PrecacheString]](&"TRIPWIRE_DEFUSING");
		[[level.ex_PrecacheString]](&"TRIPWIRE_PLANTING");
		[[level.ex_PrecacheString]](&"TRIPWIRE_ACTIVATE");
		[[level.ex_PrecacheString]](&"TRIPWIRE_TOO_CLOSE_BASE");
		[[level.ex_PrecacheString]](&"TRIPWIRE_TOO_CLOSE_FLAG");
		
		// tripwire sniper messages
		[[level.ex_PrecacheString]](&"TRIPWIRE_CHANGE_SNIPER");
		if(level.ex_wepo_class == 2 && !level.ex_wepo_sidearm) [[level.ex_PrecacheString]](&"TRIPWIRE_SNIPER_ONLY");
	}

	if(level.ex_mapvote || level.ex_svrmsg_info)
	{
		// Pre-cache strings for map announcement system
		[[level.ex_PrecacheString]](&"MAPROTATION_CUSTOM_NEXT");
		[[level.ex_PrecacheString]](&"MAPROTATION_NEXT_MAP");
		[[level.ex_PrecacheString]](&"MAPROTATION_NEXT_GT");
		[[level.ex_PrecacheString]](&"MAPROTATION_TITLE");

		// Pre-cache strings for extended map voting system
		[[level.ex_PrecacheString]](&"MAPVOTE_TITLE");
		[[level.ex_PrecacheString]](&"MAPVOTE_HEADERS");
		[[level.ex_PrecacheString]](&"MAPVOTE_HOWTO");
		[[level.ex_PrecacheString]](&"MAPVOTE_TIMELEFT");
		[[level.ex_PrecacheString]](&"MAPVOTE_INPROGRESS");
		[[level.ex_PrecacheString]](&"MAPVOTE_NOTALLOWED");
		[[level.ex_PrecacheString]](&"MAPVOTE_PLEASEWAIT");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1OF1");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1OF2");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1OF3");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1OF4");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE1OF5");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE2OF2");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE2OF3");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE2OF4");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE2OF5");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE3OF3");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE3OF4");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE3OF5");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE4OF4");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE4OF5");
		[[level.ex_PrecacheString]](&"MAPVOTE_PAGE5OF5");
		[[level.ex_PrecacheString]](&"MAPVOTE_REPLAY");
		[[level.ex_PrecacheString]](&"MAPVOTE_INFORM");
		[[level.ex_PrecacheString]](&"MAPVOTE_WINNER");

		// Pre-cache game types for extended map voting system
		[[level.ex_PrecacheString]](&"MPUI_CLASSIC_HEADQUARTERS");
		[[level.ex_PrecacheString]](&"MPUI_CONQUEST");
		[[level.ex_PrecacheString]](&"MPUI_CAPTURE_THE_FLAG");
		[[level.ex_PrecacheString]](&"MPUI_CAPTURE_THE_FLAG_BACK");
		[[level.ex_PrecacheString]](&"MPUI_DEATHMATCH");
		[[level.ex_PrecacheString]](&"MPUI_DOMINATION");
		[[level.ex_PrecacheString]](&"MPUI_ENHANCED_SD");
		[[level.ex_PrecacheString]](&"MPUI_HITMAN");
		[[level.ex_PrecacheString]](&"MPUI_HEADQUARTERS");
		[[level.ex_PrecacheString]](&"MPUI_HOLD_THE_FLAG");
		[[level.ex_PrecacheString]](&"MPUI_I_HOLD_THE_FLAG");
		[[level.ex_PrecacheString]](&"MPUI_LIBERATION");
		[[level.ex_PrecacheString]](&"MPUI_LAST_MAN_STANDING");
		[[level.ex_PrecacheString]](&"MPUI_LAST_TEAM_STANDING");
		[[level.ex_PrecacheString]](&"MPUI_ONSLAUGHT");
		[[level.ex_PrecacheString]](&"MPUI_ROUNDBASED_CNQ");
		[[level.ex_PrecacheString]](&"MPUI_ROUNDBASED_CTF");
		[[level.ex_PrecacheString]](&"MPUI_SEARCH_AND_DESTROY");
		[[level.ex_PrecacheString]](&"MPUI_TEAM_DEATHMATCH");
		[[level.ex_PrecacheString]](&"MPUI_VERY_IMPORTANT_PERSON");
		[[level.ex_PrecacheString]](&"MPUI_TEAM_KING_OF_THE_HILL");

		// Pre-cache game type abbreviations for extended map voting system
		[[level.ex_PrecacheString]](&"MPUI_CHQ");
		[[level.ex_PrecacheString]](&"MPUI_CNQ");
		[[level.ex_PrecacheString]](&"MPUI_CTF");
		[[level.ex_PrecacheString]](&"MPUI_CTFB");
		[[level.ex_PrecacheString]](&"MPUI_DM");
		[[level.ex_PrecacheString]](&"MPUI_DOM");
		[[level.ex_PrecacheString]](&"MPUI_ESD");
		[[level.ex_PrecacheString]](&"MPUI_HM");
		[[level.ex_PrecacheString]](&"MPUI_HQ");
		[[level.ex_PrecacheString]](&"MPUI_HTF");
		[[level.ex_PrecacheString]](&"MPUI_IHTF");
		[[level.ex_PrecacheString]](&"MPUI_LIB");
		[[level.ex_PrecacheString]](&"MPUI_LMS");
		[[level.ex_PrecacheString]](&"MPUI_LTS");
		[[level.ex_PrecacheString]](&"MPUI_ONS");
		[[level.ex_PrecacheString]](&"MPUI_RBCNQ");
		[[level.ex_PrecacheString]](&"MPUI_RBCTF");
		[[level.ex_PrecacheString]](&"MPUI_SD");
		[[level.ex_PrecacheString]](&"MPUI_TDM");
		[[level.ex_PrecacheString]](&"MPUI_VIP");
		[[level.ex_PrecacheString]](&"MPUI_TKOTH");

		// Pre-cache map long names for extended map voting system
		for(i = 0; i < level.ex_maps.size; i++)
		[[level.ex_PrecacheString]](level.ex_maps[i].loclname);	
	}

	if(level.ex_spwn_time)
	{
		[[level.ex_PrecacheString]](&"SPAWNPROTECTION_ENABLED");
		[[level.ex_PrecacheString]](&"SPAWNPROTECTION_DISABLED");
		[[level.ex_PrecacheString]](&"SPAWNPROTECTION_FIRE_BUTTON_PRESSED");
		[[level.ex_PrecacheString]](&"SPAWNPROTECTION_MOVED_AWAY_AREA");
	}

	// mod text
	if(level.ex_modtext)
	{
		[[level.ex_PrecacheString]](&"MOD_MESSAGE_NAME");
		[[level.ex_PrecacheString]](&"MOD_MESSAGE_BY");
		[[level.ex_PrecacheString]](&"MOD_MESSAGE_WEBSITE");
	}

	// clan logotxt
	if(level.ex_clantext) [[level.ex_PrecacheString]](level.ex_clanlotxt);

	if(level.ex_sinbin)
	{
		[[level.ex_PrecacheString]](&"SINBIN_FREEZE");
		[[level.ex_PrecacheString]](&"SINBIN_FREEFALL");
	}

	//spectator music control messages
	if(level.ex_specmusic)
	{
		[[level.ex_PrecacheString]](&"MISC_MELEE_CHANGE_MUSIC");
		[[level.ex_PrecacheString]](&"MISC_MUSIC_CHNG");
	}

	// range finder
	if(level.ex_rangefinder)
	{
		[[level.ex_PrecacheString]](&"MISC_RANGE");
		[[level.ex_PrecacheString]](&"MISC_RANGE2");
	}

	// unfixed turrets
	if(level.ex_turrets == 2)
	{
		[[level.ex_PrecacheString]](&"TURRET_MELEE_TO_PICKUP");
		[[level.ex_PrecacheString]](&"TURRET_MELEE_TO PLANT");
		[[level.ex_PrecacheString]](&"TURRET_DEPLANT");
		[[level.ex_PrecacheString]](&"TURRET_PLANTING");
		[[level.ex_PrecacheString]](&"TURRET_USE_SHOW_ICON");
		[[level.ex_PrecacheString]](&"TURRET_TOO_CLOSE_TURRET");
		[[level.ex_PrecacheString]](&"TURRET_TOO_CLOSE");
		[[level.ex_PrecacheString]](&"TURRET_TOO_FAR");
	}

	// landmines
	if(level.ex_landmines)
	{
		[[level.ex_PrecacheString]](&"LANDMINES_WARNING");
		[[level.ex_PrecacheString]](&"LANDMINES_PLANTING");
		[[level.ex_PrecacheString]](&"LANDMINES_DEFUSE");
		[[level.ex_PrecacheString]](&"LANDMINES_PLANTED");
		[[level.ex_PrecacheString]](&"LANDMINES_DEFUSED");
		[[level.ex_PrecacheString]](&"LANDMINES_WRONG_SURFACE");
		[[level.ex_PrecacheString]](&"LANDMINES_TOO_CLOSE_BASE");
		[[level.ex_PrecacheString]](&"LANDMINES_TOO_CLOSE_FLAG");
		[[level.ex_PrecacheString]](&"LANDMINES_MAXIMUM");
	}
}

precacheshaders()
{
	// unfixed turrets
	if(level.ex_turrets == 2)
	{
		[[level.ex_PrecacheShader]]("objpoint_star");
	}

	// landmines
	if(level.ex_landmines)
		[[level.ex_PrecacheShader]]("gfx/custom/bblandhud2.tga");

	// bullet holes
	if(level.ex_bulletholes)
	{
		[[level.ex_PrecacheShader]]("gfx/custom/bullethit_glass.tga");
		[[level.ex_PrecacheShader]]("gfx/custom/bullethit_glass2.tga");
	}

	// ammo crates
	if(level.ex_amc_compass)
	{
		[[level.ex_PrecacheShader]]("compassping_ammocrate");
	}

	// logos
	if(level.ex_logopic)
	{
		[[level.ex_PrecacheShader]]("gfx/custom/logo_extreme.tga");
		[[level.ex_PrecacheShader]]("gfx/custom/logo_cod.tga");
	}

	// tripwires
	if(level.ex_tweapon)
	{
		[[level.ex_PrecacheShader]]("hud_us_smokegrenade_C");
		[[level.ex_PrecacheShader]]("killiconsuicide");
		[[level.ex_PrecacheShader]]("gfx/icons/hud@satchel_charge1.tga");
	}

	if(level.ex_bloodonscreen)
	{
		[[level.ex_PrecacheShader]]("gfx/impact/flesh_hit2");
		[[level.ex_PrecacheShader]]("gfx/impact/flesh_hitgib");
	}

	if(level.ex_campwarntime >= 1)
	{
		[[level.ex_PrecacheShader]]("objpoint_radio");
		[[level.ex_PrecacheShader]]("field_radio");
	}

	if(level.ex_healthbar || level.ex_sprint)
	{
		[[level.ex_PrecacheShader]]("gfx/hud/hud@health_back.tga");
		[[level.ex_PrecacheShader]]("gfx/hud/hud@health_bar.tga");
	}

	if(level.ex_spwn_time || level.ex_healthbar || level.ex_callformedic) [[level.ex_PrecacheShader]]("gfx/hud/hud@health_cross.tga");

	if(level.ex_codhitblip) [[level.ex_PrecacheShader]]("gfx/reticle/mg42_cross.tga");

	if(level.ex_ranksystem)
	{
		[[level.ex_PrecacheShader]](game["mortar"]);
		[[level.ex_PrecacheShader]](game["artillery"]);
		[[level.ex_PrecacheShader]](game["airstrike"]);
	}

	// generic, used by almost everything
	[[level.ex_PrecacheShader]]("black");
	[[level.ex_PrecacheShader]]("white");
}

precachemodels()
{
	if(level.ex_drophealth)
	{
		[[level.ex_PrecacheModel]]("xmodel/health_small");
		[[level.ex_PrecacheModel]]("xmodel/health_medium");
		[[level.ex_PrecacheModel]]("xmodel/health_large");
	}

	if(level.ex_artillery || level.ex_cmdmonitor || level.ex_mortars || level.ex_planes || level.ex_ranksystem || (level.ex_amc_perteam && level.ex_amc_chutein))
	{
		[[level.ex_PrecacheModel]]("xmodel/vehicle_stuka_flying");
		[[level.ex_PrecacheModel]]("xmodel/vehicle_spitfire_flying");
		[[level.ex_PrecacheModel]]("xmodel/vehicle_p51_mustang");
		[[level.ex_PrecacheModel]]("xmodel/vehicle_condor");
		[[level.ex_PrecacheModel]]("xmodel/mebelle1");
		[[level.ex_PrecacheModel]]("xmodel/prop_stuka_bomb");
	}

	// Precache parachute
	if(level.ex_parachutes || (level.ex_amc_perteam && level.ex_amc_chutein)) [[level.ex_PrecacheModel]]("xmodel/am_fallschirm");

	if(level.ex_cmdmonitor_models)
	{
		[[level.ex_PrecacheModel]]("xmodel/furniture_bathtub");
		[[level.ex_PrecacheModel]]("xmodel/furniture_toilet");
		[[level.ex_PrecacheModel]]("xmodel/tree_grey_oak_sm_a");
		[[level.ex_PrecacheModel]]("xmodel/tree_pine_sm_b");
		[[level.ex_PrecacheModel]]("xmodel/prop_bear");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone1");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone2");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone3");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone4");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone5");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone6");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone7");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone8");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone9");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone10");
		[[level.ex_PrecacheModel]]("xmodel/prop_tombstone11");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_benzin");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_black");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_green");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_silver");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_tan");
		[[level.ex_PrecacheModel]]("xmodel/prop_barrel_white");
		[[level.ex_PrecacheModel]]("xmodel/furniture_bedmattress1");
		[[level.ex_PrecacheModel]]("xmodel/furniture_bedmattress2");
		[[level.ex_PrecacheModel]]("xmodel/furniture_bedmattress_bunker");
		[[level.ex_PrecacheModel]]("xmodel/furniture_piano");
		[[level.ex_PrecacheModel]]("xmodel/prop_bike");
		[[level.ex_PrecacheModel]]("xmodel/prop_haybale");
		[[level.ex_PrecacheModel]]("xmodel/prop_hydrant");
		[[level.ex_PrecacheModel]]("xmodel/prop_tractor");
	}

	// knife
	[[level.ex_PrecacheModel]]("xmodel/weapon_knife");

	// ammocrates
	if(level.ex_amc_perteam)
	{
		[[level.ex_PrecacheModel]]("xmodel/prop_crate_smallshipping_open1");
		[[level.ex_PrecacheModel]]("xmodel/prop_mortar_crate2");
	}

	// unfixed turrets
	if(level.ex_turrets == 2)
	{
		[[level.ex_PrecacheModel]]("xmodel/weapon_30cal");
		[[level.ex_PrecacheModel]]("xmodel/weapon_mg42");
	}

	// landmines
	if(level.ex_landmines)
		[[level.ex_PrecacheModel]]("xmodel/bblandmine");
}

precacheheadicons()
{
	if(level.ex_spwn_time) [[level.ex_PrecacheHeadIcon]](game["headicon_protect"]);
}

postmapload_precachestrings()
{
	if(level.ex_rankhud)
	{
		switch(game["allies"])
		{
			case "american":
			{
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_7"); // General
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_6"); // Colonel
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_5"); // Major
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_4"); // Captain
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_3"); // Lieutenant
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_2"); // Sergeant
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_1"); // Corporal
				[[level.ex_PrecacheString]](&"RANK_AMERICAN_0"); // Private
				break;
			}	
				
			case "british":
			{
				[[level.ex_PrecacheString]](&"RANK_BRITISH_7"); // General
				[[level.ex_PrecacheString]](&"RANK_BRITISH_6"); // Colonel
				[[level.ex_PrecacheString]](&"RANK_BRITISH_5"); // Major
				[[level.ex_PrecacheString]](&"RANK_BRITISH_4"); // Captain
				[[level.ex_PrecacheString]](&"RANK_BRITISH_3"); // Lieutenant
				[[level.ex_PrecacheString]](&"RANK_BRITISH_2"); // Sergeant
				[[level.ex_PrecacheString]](&"RANK_BRITISH_1"); // Corporal
				[[level.ex_PrecacheString]](&"RANK_BRITISH_0"); // Private
				break;
			}
	
			default:
			{
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_7"); // General-Poruchik
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_6"); // Polkovnik
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_5"); // Mayor
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_4"); // Kapitan
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_3"); // Leytenant
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_2"); // Podpraporshchik
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_1"); // Kapral
				[[level.ex_PrecacheString]](&"RANK_RUSSIAN_0"); // Soldat
				break;
			}
		}

		[[level.ex_PrecacheString]](&"RANK_GERMAN_7"); // General
		[[level.ex_PrecacheString]](&"RANK_GERMAN_6"); // Oberst
		[[level.ex_PrecacheString]](&"RANK_GERMAN_5"); // Major
		[[level.ex_PrecacheString]](&"RANK_GERMAN_4"); // Hauptmann
		[[level.ex_PrecacheString]](&"RANK_GERMAN_3"); // Leutnant
		[[level.ex_PrecacheString]](&"RANK_GERMAN_2"); // Unterfeldwebel
		[[level.ex_PrecacheString]](&"RANK_GERMAN_1"); // Unteroffizier
		[[level.ex_PrecacheString]](&"RANK_GERMAN_0"); // Grenadier

		[[level.ex_PrecacheString]](&"RANK_RANK");
	}

	if(level.ex_amc_perteam && level.ex_amc_msg >= 2)
	{
		switch(game["allies"])
		{
			case "american": [[level.ex_PrecacheString]](&"AMMOCRATE_DENY_AMERICAN");	break;
			case "british":		[[level.ex_PrecacheString]](&"AMMOCRATE_DENY_BRITISH");		break;
			default:					[[level.ex_PrecacheString]](&"AMMOCRATE_DENY_RUSSIAN");	break;
		}
		
		[[level.ex_PrecacheString]](&"AMMOCRATE_DENY_GERMAN");
		[[level.ex_PrecacheString]](&"AMMOCRATE_ACTIVATE");
		[[level.ex_PrecacheString]](&"AMMOCRATE_REARMING_WEAPONS");
		[[level.ex_PrecacheString]](&"AMMOCRATE_REARMING_GRENADES");
		[[level.ex_PrecacheString]](&"AMMOCRATE_REARMING_FIRSTAID");

	}
}

postmapload_precacheshaders()
{
	// Tripwires
	if(level.ex_tweapon)
	{
		switch(game["allies"])
		{
			case "american": grenadeicon = "gfx/icons/hud@us_grenade_C.tga";			break;
			case "british":  grenadeicon = "gfx/icons/hud@british_grenade_C.tga";		break;
			default:         grenadeicon = "gfx/icons/hud@russian_grenade_C.tga";	break;
		}

		[[level.ex_precacheShader]](grenadeicon);
		[[level.ex_PrecacheShader]]("gfx/icons/hud@steilhandgrenate_C.tga");
		[[level.ex_PrecacheShader]]("gas_grenade");
		[[level.ex_PrecacheShader]]("gfx/icons/hud@incenhandgrenade_c.tga");
	}

	if(level.ex_logopic == 2)
	{
		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;
		}
		
		[[level.ex_PrecacheShader]](logo);
		[[level.ex_PrecacheShader]]("gfx/custom/logo_german.tga");
	}

	// team icons
	if(level.ex_stbd || level.ex_campwarntime)
	{
		switch(game["allies"])
		{
			case "american": [[level.ex_PrecacheShader]]("objective_american"); break;
			case "british":  [[level.ex_PrecacheShader]]("objective_british"); break;
			default:         [[level.ex_PrecacheShader]]("objective_russian"); break;
		}

		[[level.ex_PrecacheShader]]("objective_german");
	}
	
	[[level.ex_precacheShader]](game["headicon_allies"]);
	[[level.ex_precacheShader]](game["headicon_axis"]);
	[[level.ex_precacheShader]]("hud_status_dead");
}

postmapload_loadfx()
{
	// nation based smoke colours
	loadsmokefx(getSmokeColour(level.ex_smoke[game["allies"]]));
	loadsmokefx(getSmokeColour(level.ex_smoke["german"]));

	// coldbreath FX
	if(level.ex_wintermap && level.ex_coldbreathfx) level.ex_effect["coldbreathfx"] = loadfx ("fx/misc/cold_breath.efx");
}

loadsmokefx(colour)
{
	switch(colour)
	{
		case "_":        level.ex_effect["greysmoke"]   = loadFx("fx/props/american_smoke_grenade.efx"); break;
		case "_blue_":   level.ex_effect["bluesmoke"]   = loadFx("fx/extreme_smoke/blue_main.efx");      break;
		case "_green_":  level.ex_effect["greensmoke"]  = loadFx("fx/extreme_smoke/green_main.efx");     break;
		case "_orange_": level.ex_effect["orangesmoke"] = loadFx("fx/extreme_smoke/orange_main.efx");    break;
		case "_pink_":   level.ex_effect["pinksmoke"]   = loadFx("fx/extreme_smoke/pink_main.efx");      break;
		case "_red_":    level.ex_effect["redsmoke"]    = loadFx("fx/extreme_smoke/red_main.efx");       break;
		case "_yellow_": level.ex_effect["yellowsmoke"] = loadFx("fx/extreme_smoke/yellow_main.efx");    break;
	}
}
