#include ww2x\_wwx_weapons;
#include ww2x\_drm;

main()
{
	//************************************************************************************************************************************************************************
	// WW2X setup commonly used function alias
	//************************************************************************************************************************************************************************
	level.wwx_cvardef = ww2x\_wwx_utils::cvardef;
      level thread ww2x\_drm::drm_init();
	level.drm_cvardef = ww2x\_drm::cvardef;	
	level.wwx_clearlnb = ww2x\_wwx_utils::excllnbo;	
	level.wwx_PrecacheShader = ww2x\_wwx_utils::wwx_PrecacheShader;
	level.wwx_PrecacheHeadIcon = ww2x\_wwx_utils::wwx_PrecacheHeadIcon;
	level.wwx_PrecacheStatusIcon = ww2x\_wwx_utils::wwx_PrecacheStatusIcon;
	level.wwx_PrecacheModel = ww2x\_wwx_utils::wwx_PrecacheModel;
	level.wwx_PrecacheItem = ww2x\_wwx_utils::wwx_PrecacheItem;	
	level.wwx_PrecacheString = ww2x\_wwx_utils::wwx_PrecacheString;
	level.wwx_precacheForcedWeapon = ww2x\_wwx_utils::wwx_precacheForcedWeapon;
	level.wwx_PrecacheMenuItem = ww2x\_wwx_utils::wwx_PrecacheMenuItem;	
	level.wwx_PrecacheShellShock = ww2x\_wwx_utils::wwx_PrecacheShellShock;		
	level.wwx_getStance = ww2x\_wwx_utils::GetStance;				
	level.wwx_vectorscale = ww2x\_wwx_utils::vectorscale;				
	level.wwx_vectormulti = ww2x\_wwx_utils::vectormulti;			
	//level.wwx_isADS = ww2x\_wwx_utils::isADS;			
	level thread ww2x\_wwx_turrets::init();

	// Override callbackPlayerDamage
	level.wwx_orignalPlayerDamage = level.callbackPlayerDamage;						
	level.callbackPlayerDamage = ww2x\_wwx_main::wwxplayerdamage;

	// Parachuting
	//**********************************************************************************************// New
	level.wwx_parachutes = [[level.drm_cvardef]]("wwx_parachutes", 0, 0, 3, "int");
	level.wwx_parachutesonlyattackers = [[level.drm_cvardef]]("wwx_parachutes_only_attackers", 0, 0, 1, "int");
	level.wwx_parachutesprotection = [[level.drm_cvardef]]("wwx_parachutes_protection", 2, 0, 2, "int");
	level.wwx_parachuteslimitaltitude = [[level.drm_cvardef]]("wwx_parachutes_limit_altitude", 1700, 0, 6000, "int");

      //**********************************************************************************************
      // Heavy mobile mg's
      //**********************************************************************************************
      level.wwx_sprintheavymg = [[level.drm_cvardef]]("wwx_heavy_mg",0,0,1,"int");

      //**********************************************************************************************
      // Special grenades
      //**********************************************************************************************
      level.wwx_firenades = [[level.drm_cvardef]]("wwx_fire_grenades",0,0,1,"int");
      level.wwx_gasnades = [[level.drm_cvardef]]("wwx_gas_grenades",0,0,1,"int");
      level.wwx_stickynades = [[level.drm_cvardef]]("wwx_sticky_grenades",0,0,1,"int");
      level.wwx_satchels = [[level.drm_cvardef]]("wwx_satchels",0,0,1,"int");

      //**********************************************************************************************
      // Range Finder
      //**********************************************************************************************
      level.wwx_rangefinder = [[level.drm_cvardef]]("wwx_rangefinder",0,0,1,"int");
      level.wwx_rfrange = [[level.drm_cvardef]]("wwx_rfunit",1,0,1,"int");

      //**********************************************************************************************
      // Console(log) spam messages reducer 
      //**********************************************************************************************
      level.wwx_linux_server = [[level.wwx_cvardef]]("wwx_is_linux",0,0,2,"int");

      //**********************************************************************************************
      // Weapons on back 
      //**********************************************************************************************
      level.wwx_wepsonback = [[level.drm_cvardef]]("wwx_wepsonback",0,0,1,"int");

	//************************************************************************************************************************************************************************
	// WW2X ambient fx control
	//************************************************************************************************************************************************************************
	level.wwx_ambmapfog = [[level.drm_cvardef]]("wwx_ambmapfog", 1, 0, 1, "int");
	level.wwx_ambmapsound = [[level.drm_cvardef]]("wwx_ambmapsound", 1, 0, 1, "int");
	level.wwx_ambsoundfx = [[level.drm_cvardef]]("wwx_ambsoundfx", 1, 0, 1, "int");

	level.wwx_ambfirefx = [[level.drm_cvardef]]("wwx_ambfirefx", 1, 0, 1, "int");
	level.wwx_ambsmokefx = [[level.drm_cvardef]]("wwx_ambsmokefx", 1, 0, 1, "int");
	level.wwx_ambfogbankfx = [[level.drm_cvardef]]("wwx_ambfogbankfx", 1, 0, 1, "int");
	level.wwx_ambfliesfx = [[level.drm_cvardef]]("wwx_ambfliesfx", 1, 0, 1, "int");
	level.wwx_ambdustfx = [[level.drm_cvardef]]("wwx_ambdustfx", 1, 0, 1, "int");
	level.wwx_ambsnowfx = [[level.drm_cvardef]]("wwx_ambsnowfx", 1, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X make current gametype and map as level variables
	//************************************************************************************************************************************************************************
	level.wwx_currentgt = getcvar("g_gametype");
	level.wwx_currentmap = getcvar("mapname");

	//****************************************************************************
	// Initialize map array for in-game and end-game map vote systems
	//****************************************************************************
	level thread ww2x\_wwx_mapvote::init();

	//************************************************************************************************************************************************************************
	// WW2X map pause / gametype start delay
	//************************************************************************************************************************************************************************
	level.wwx_gtsdelay = [[level.drm_cvardef]]("wwx_gtsdelay",0,0,60,"int");

	//************************************************************************************************************************************************************************
	// WW2X music options
	//************************************************************************************************************************************************************************
	level.wwx_specmusic= [[level.drm_cvardef]]("wwx_specmusic",0,0,1,"int");
	level.wwx_deathmusic = [[level.drm_cvardef]]("wwx_deathmusic",0,0,1,"int");
	level.wwx_endmusic = [[level.drm_cvardef]]("wwx_endmusic", 0, 0, 1, "int");
	level.wwx_endmusic_time = [[level.drm_cvardef]]("wwx_endmusic_time", 10, 0, 30, "float");
	level.wwx_mvmusic = [[level.drm_cvardef]]("wwx_votemusic",0,0,1,"int");
	level.wwx_stbdm = [[level.drm_cvardef]]("wwx_statsmusic",0,0,1,"int");

	// end music override!
	if(level.wwx_endmusic)
	{
		level.wwx_mvmusic = 0;
		level.wwx_stbdm = 0;
	}

	//************************************************************************************************************************************************************************
	// WW2X gametype checks
	//************************************************************************************************************************************************************************
      // teamplay
	if(level.wwx_currentgt != "dm" && level.wwx_currentgt != "ihtf" && level.wwx_currentgt != "lms") level.wwx_teamplay = true;
      else level.wwx_teamplay = false;

	// roundbased
	if(level.wwx_currentgt == "sd" || level.wwx_currentgt == "lts" || level.wwx_currentgt == "esd") level.wwx_roundbased = true;
	else level.wwx_roundbased = false;	

	// flagbased
	if(level.wwx_currentgt == "ctf" || level.wwx_currentgt == "htf" || level.wwx_currentgt == "ctfb") level.wwx_flagbased = true;
	else level.wwx_flagbased = false;

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

	// setup gametype common variables
	thread ww2x\_wwx_gtcommon::init();

	//************************************************************************************************************************************************************************
	// WW2X gametype options
	//************************************************************************************************************************************************************************
	level.wwx_swapteams = [[level.drm_cvardef]]("wwx_swapteams", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X diagnostics and debug
	//************************************************************************************************************************************************************************
	level.wwx_diag_bots = [[level.drm_cvardef]]("wwx_diag_bots", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X security GUID check (disabled until COD2 guid function is fixed)
	//************************************************************************************************************************************************************************
	//level.wwx_security = [[level.drm_cvardef]]("wwx_security", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X define level variables
	//************************************************************************************************************************************************************************
	level.wwx_gameover = false;
	level.wwx_fbannounce = true;
	level.wwx_flakison = false;

	// set plane variables
	level.wwx_axisapinsky = 0;
	level.wwx_allieapinsky = 0;
	level.wwx_paxisapinsky = 0;
	level.wwx_pallieapinsky = 0;
	level.wwx_planescrashed = 0;

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

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

	//************************************************************************************************************************************************************************
	// WW2X log file
	//************************************************************************************************************************************************************************
	level.wwx_logfile = [[level.drm_cvardef]]("wwx_log_file", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X bleeding
	//************************************************************************************************************************************************************************
	level.wwx_bleeding = [[level.drm_cvardef]]("wwx_bleeding", 0, 0, 1, "int");

	if(level.wwx_bleeding)
	{
		level.wwx_startbleed = [[level.drm_cvardef]]("wwx_startbleed", 80, 1, 99, "int");
		level.wwx_maxbleed = [[level.drm_cvardef]]("wwx_maxbleed", 100, 0, 100, "int");
		level.wwx_bleedmsg = [[level.drm_cvardef]]("wwx_bleedmsg", 0, 0, 1, "int");
		level.wwx_bleedsound = [[level.drm_cvardef]]("wwx_bleedsound", 0, 0, 3, "int");
	}
	else level.wwx_bleedmsg = 0;

	//************************************************************************************************************************************************************************
	// WW2X dead body handling
	//************************************************************************************************************************************************************************
	level.wwx_deadbodyfx = [[level.drm_cvardef]]("wwx_deadbodyfx", 0, 0, 3, "int");

	//************************************************************************************************************************************************************************
	// WW2X bulletholes
	//************************************************************************************************************************************************************************
	level.wwx_bulletholes = [[level.drm_cvardef]]("wwx_bulletholes", 0, 0, 2, "int");

	//************************************************************************************************************************************************************************
	// WW2X stance shoot delay monitor
	//************************************************************************************************************************************************************************
	level.wwx_stanceshoot = [[level.drm_cvardef]]("wwx_stanceshoot", 0, 0, 3, "int");
	level.wwx_jump_sensitivity = [[level.drm_cvardef]]("wwx_jump_sensitivity", 5, 0, 10, "int");

	//************************************************************************************************************************************************************************
	// WW2X rank system
	//************************************************************************************************************************************************************************
	level.wwx_ranksystem = [[level.drm_cvardef]]("wwx_ranksystem", 0, 0, 1, "int");
	level.wwx_rankhud = [[level.drm_cvardef]]("wwx_rankhud", 0, 0, 1, "int");
	level.wwx_rank_announce = [[level.drm_cvardef]]("wwx_rank_announce", 0, 0, 2, "int");
	level.wwx_rank_promo_addnades = [[level.drm_cvardef]]("wwx_rank_promo_addnades", 1, 0, 1, "int");

	// set ranksystem values
	if(level.wwx_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.drm_cvardef]]("wwx_rank_gunclips_" + i, i, 0, 12, "int");
	
			// pistol clips
			game["rank_ammo_pistolclips_" + i]= [[level.drm_cvardef]]("wwx_rank_pistolclips_" + i, i, 0, 12, "int");
	
			// grenades
			game["rank_ammo_grenades_" + i] = [[level.drm_cvardef]]("wwx_rank_grenades_" + i, i, 0, 9, "int");
	
			// smoke grenades
			game["rank_ammo_smoke_grenades_" + i] = [[level.drm_cvardef]]("wwx_rank_smoke_" + i, i, 0, 9, "int");
	
			// landmines
			game["rank_ammo_landmines_" + i] = [[level.drm_cvardef]]("wwx_rank_landmines_" + i, i, 0, 9, "int");

			// first aid kits
			game["rank_firstaid_kits_" + i] = [[level.drm_cvardef]]("wwx_rank_firstaid_" + i, i, 0, 9, "int");
	
			// set points required for each rank
			game["rank_" + i] = [[level.drm_cvardef]]("wwx_rank_points_" + i, 5 * i, 0, 200, "int");
		}
	
		// set up wmd's	 - mortars
		level.wwx_rank_mortar = [[level.drm_cvardef]]("wwx_rank_mortar", 3, 0, 7, "int");
		level.wwx_rank_mortar_first = [[level.drm_cvardef]]("wwx_rank_mortar_first", 10, 10, 300, "int");
		level.wwx_rank_mortar_int = [[level.drm_cvardef]]("wwx_rank_mortar_int", 10, 10, 600, "int");
		mradius = [[level.drm_cvardef]]("wwx_rank_mortar_radius", 1, 1, 3, "int");
            level.wwx_frndly = [[level.drm_cvardef]]("wwx_frndly", 0, 0, 1, "int");

		switch(mradius)
		{
			case 1:	radius = 1000;	break;
			case 2: radius = 750;	break;
			default:	radius = 500;	break;
		}
		
		level.wwx_rank_mortar_radius = radius;
	
		// set up wmd's	 - artillery
		level.wwx_rank_artillery = [[level.drm_cvardef]]("wwx_rank_artillery", 4, level.wwx_rank_mortar + 1, 7, "int");
		level.wwx_rank_artillery_first = [[level.drm_cvardef]]("wwx_rank_artillery_first", 10, 10, 300, "int");
		level.wwx_rank_artillery_int = [[level.drm_cvardef]]("wwx_rank_artillery_int", 10, 10, 600, "int");
		artradius = [[level.drm_cvardef]]("wwx_rank_artillery_radius", 1, 1, 3, "int");

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

		level.wwx_rank_artillery_radius = radius;
	
		// set up wmd's	 - airstrike
		level.wwx_rank_airstrike = [[level.drm_cvardef]]("wwx_rank_airstrike", 5, level.wwx_rank_artillery + 1, 7, "int");
		level.wwx_rank_airstrike_first = [[level.drm_cvardef]]("wwx_rank_airstrike_first", 10, 10, 300, "int");
		level.wwx_rank_airstrike_int = [[level.drm_cvardef]]("wwx_rank_airstrike_int", 10, 10, 600, "int");
		astradius = [[level.drm_cvardef]]("wwx_rank_airstrike_radius", 1, 1, 3, "int");

		// rank for napalm
		level.wwx_rank_napalm = [[level.drm_cvardef]]("wwx_rank_napalm", 7, level.wwx_rank_airstrike + 1, 7, "int");
	
		switch(astradius)
		{
			case 1:	radius = 1000;	break;
			case 2: radius = 750;	break;
			default:	radius = 500;	break;
		}

		level.wwx_rank_airstrike_radius = radius;

		// set other ranksystem variables	
		level.wwx_rank_wmdtype = [[level.drm_cvardef]]("wwx_rank_wmdtype", 0, 0, 2, "int");
		level.wwx_rank_wmd_min = [[level.drm_cvardef]]("wwx_rank_wmd_min", 30, 10, 300, "int");
		level.wwx_rank_wmd_max = [[level.drm_cvardef]]("wwx_rank_wmd_max", level.wwx_rank_wmd_min + 10, level.wwx_rank_wmd_min + 10, 600, "int");
		level.wwx_rank_wmd_flare = [[level.drm_cvardef]]("wwx_rank_wmd_flare", 0, 0, 1, "int");
	
		level.wwx_rank_allow_mortar = [[level.drm_cvardef]]("wwx_rank_allow_mortar", 0, 0, 1, "int");
		level.wwx_rank_allow_artillery = [[level.drm_cvardef]]("wwx_rank_allow_artillery", 0, 0, 1, "int");
		level.wwx_rank_allow_airstrike = [[level.drm_cvardef]]("wwx_rank_allow_airstrike", 0, 0, 1, "int");
		level.wwx_rank_allow_napalm = [[level.drm_cvardef]]("wwx_rank_allow_napalm", 0, 0, 1, "int");
                level.wwx_score = [[level.drm_cvardef]]("wwx_rank_score", 0, 0, 1, "int");
		level.wwx_rank_allow_rank = [[level.drm_cvardef]]("wwx_rank_allow_rank", 0, 0, 7, "int");
	}

	//************************************************************************************************************************************************************************
	// WW2X tripwires
	//************************************************************************************************************************************************************************
	level.wwx_tweapon = [[level.drm_cvardef]]("wwx_tripwire", 0, 0, 3, "int");
	level.wwx_tweaponlimit = [[level.drm_cvardef]]("wwx_tripwire_limit", 5, 1, 10, "int");
	level.wwx_tweaponwarning = [[level.drm_cvardef]]("wwx_tripwire_warning", 1, 0, 1, "int");
	level.wwx_tweapon_radius = 12 * [[level.drm_cvardef]]("wwx_tripwire_radius",12, 1, 999, "int");

	if(level.wwx_tweapon)
	{
		if(level.wwx_teamplay)
		{
			level.wwx_tweapons["axis"] = 0;
			level.wwx_tweapons["allies"] = 0;
		}
		else level.wwx_tweapons = 0;
	}

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

	//************************************************************************************************************************************************************************
	// WW2X blood on screen
	//************************************************************************************************************************************************************************
	level.wwx_bloodonscreen = [[level.drm_cvardef]]("wwx_bloodonscreen", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X logo
	//************************************************************************************************************************************************************************
	level.wwx_logopic = [[level.drm_cvardef]]("wwx_logopic", 0, 0, 2, "int");

	//************************************************************************************************************************************************************************
	// WW2X force autoassign on team menu
	//************************************************************************************************************************************************************************
	level.wwx_forceauto = [[level.drm_cvardef]]("wwx_forceauto", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X livestats!
	//************************************************************************************************************************************************************************
	level.wwx_livestats = [[level.drm_cvardef]]("wwx_livestats", 0, 0, 1, "int");

	//****************************************************************************
	// Inactivity Monitor
	//****************************************************************************
	level.wwx_inactive_plyr = [[level.drm_cvardef]]("wwx_inactive_plyr", 0, 0, 1, "int");
	level.wwx_inactive_spec = [[level.drm_cvardef]]("wwx_inactive_spec", 0, 0, 1, "int");
	level.wwx_inactive_time = [[level.drm_cvardef]]("wwx_inactive_time", 15, 1, 999, "int");
	level.wwx_afk = [[level.drm_cvardef]]("wwx_afk", 1, 0, 1, "int");

	//****************************************************************************
	// Server redirection
	//****************************************************************************
	level.wwx_redirect = [[level.drm_cvardef]]("wwx_redirect", 0, 0, 1, "int");
	level.wwx_redirect_ip = [[level.drm_cvardef]]("wwx_redirect_ip", "", "", "", "string");
	level.wwx_redirect_pause = [[level.drm_cvardef]]("wwx_redirect_pause", 10, 5, 60, "int");
	level.wwx_redirect_reason = [[level.drm_cvardef]]("wwx_redirect_reason", 0, 0, 3, "int");
	level.wwx_redirect_logic = [[level.drm_cvardef]]("wwx_redirect_logic", 0, 0, 2, "int");
	level.wwx_redirect_priority = [[level.drm_cvardef]]("wwx_redirect_priority", 0, 0, 4, "int");
	level.wwx_redirect_hint = [[level.drm_cvardef]]("wwx_redirect_hint", 1, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X name check
	//************************************************************************************************************************************************************************
	level.wwx_namechecker = [[level.drm_cvardef]]("wwx_namechecker", 1, 0, 1, "int");
      level.wwx_ncskipwarning = [[level.drm_cvardef]]("wwx_ncskipwarning", 1, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X damage modifiers
	//************************************************************************************************************************************************************************
	level.wwx_wdmodon = [[level.drm_cvardef]]("wwx_wdmodon", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X announcer - time remaining, score, results, firstblood, player connect
	//************************************************************************************************************************************************************************
	level.wwx_timeannouncer = [[level.drm_cvardef]]("wwx_announcer", 0, 0, 2, "int");
	level.wwx_antime = [[level.drm_cvardef]]("wwx_antime", 0, 0, 1, "int");
	level.wwx_anscore = [[level.drm_cvardef]]("wwx_anscore", 0, 0, 1, "int");
	level.wwx_anresult = [[level.drm_cvardef]]("wwx_anresult", 0, 0, 1, "int");
	level.wwx_firstblood = [[level.drm_cvardef]]("wwx_firstblood", 0, 0, 1, "int");
	level.wwx_plcdsound = [[level.drm_cvardef]]("wwx_plcdsound", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X welcome/goodluck sound
	//************************************************************************************************************************************************************************
	level.wwx_goodluck = [[level.drm_cvardef]]("wwx_goodluck", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X disable minefields
	//************************************************************************************************************************************************************************
	level.wwx_disableminefields = [[level.drm_cvardef]]("wwx_minefields", 0, 0, 1, "int");

	//****************************************************************************
	// WW2X landmines
	//****************************************************************************
	level.wwx_landmines = [[level.drm_cvardef]]("wwx_landmines", 1, 0, 1, "int");
	level.wwx_landmines_loadout = [[level.drm_cvardef]]("wwx_landmines_loadout", 1, 0, 1, "int");
	level.wwx_landmines_max = [[level.drm_cvardef]]("wwx_landmines_max", 5, 1, 32, "int");
	level.wwx_landmines_fifo = [[level.drm_cvardef]]("wwx_landmines_fifo", 1, 0, 1, "int");
	level.wwx_landmine_plant_time = [[level.drm_cvardef]]("wwx_landmine_plant_time", 5, 3, 20, "int");
	level.wwx_landmine_defuse_time = [[level.drm_cvardef]]("wwx_landmine_defuse_time", 5, 3, 20, "int");
	level.wwx_landmine_warning = [[level.drm_cvardef]]("wwx_landmine_warning", 1, 0, 1, "int");
	level.wwx_landmine_depth = [[level.drm_cvardef]]("wwx_landmine_depth", 2, 1, 2, "int");
	level.wwx_landmine_ownersafe = [[level.drm_cvardef]]("wwx_landmine_ownersafe", 1, 0, 1, "int");
	level.wwx_landmine_teamsafe = [[level.drm_cvardef]]("wwx_landmine_teamsafe", 1, 0, 1, "int");
	level.wwx_landmine_surfacecheck = [[level.drm_cvardef]]("wwx_landmine_surfacecheck", 0, 0, 1, "int");
	level.snipermines = [[level.drm_cvardef]]("scr_allow_mine_sniper", 0, 0, 9, "int");
	level.boltactionmines = [[level.drm_cvardef]]("scr_allow_mine_boltaction", 0, 0, 9, "int");
	level.semiautomines = [[level.drm_cvardef]]("scr_allow_mine_semiauto", 0, 0, 9, "int");
	level.smgmines = [[level.drm_cvardef]]("scr_allow_mine_smg", 0, 0, 9, "int");
	level.mgmines = [[level.drm_cvardef]]("scr_allow_mine_mg", 0, 0, 9, "int");
	level.shotgunmines = [[level.drm_cvardef]]("scr_allow_mine_shotgun", 0, 0, 9, "int");
	level.panzermines = [[level.drm_cvardef]]("scr_allow_mine_panzer", 0, 0, 9, "int");
	level.knifemines = [[level.drm_cvardef]]("scr_allow_mine_knife", 0, 0, 9, "int");
	level.pistolmines = [[level.drm_cvardef]]("scr_allow_mine_pistol", 0, 0, 9, "int");

	//************************************************************************************************************************************************************************
	// WW2X death/grenade indicators
	//************************************************************************************************************************************************************************
	level.wwx_deathicons = [[level.drm_cvardef]]("wwx_deathicons", 0, 0, 1, "int");
	level.wwx_grenadeind = [[level.drm_cvardef]]("wwx_grenadeind", 0, 0, 1, "int");
	level.wwx_objindicator = [[level.drm_cvardef]]("wwx_objindicator", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X grenade warning system
	//************************************************************************************************************************************************************************
	level.wwx_grenadewarn = [[level.drm_cvardef]]("wwx_grenadewarn", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X fix corrupt map rotations
	//************************************************************************************************************************************************************************
	level.wwx_fixmaprotation = [[level.wwx_cvardef]]("wwx_fix_maprotation", 0, 0, 1, "int");	

	//************************************************************************************************************************************************************************
	// WW2X random map rotation
	//************************************************************************************************************************************************************************
	level.wwx_randommaprotation = [[level.drm_cvardef]]("wwx_random_maprotation", 0, 0, 2, "int");	

      //***************************************************************************
      // ww2x map voting system
      //***************************************************************************
      level.wwx_mapvote = [[level.drm_cvardef]]("wwx_map_vote", 0, 0, 1, "int");
      if(level.wwx_mapvote)
      {
       level.wwx_mapvotemax = [[level.drm_cvardef]]("wwx_map_vote_max", 10, 5, 50, "int");
       level.wwx_mapvotemode = [[level.drm_cvardef]]("wwx_map_vote_mode", 0, 0, 3, "int");
       level.wwx_mapvotetime = [[level.drm_cvardef]]("wwx_map_vote_time", 30, 10, 180, "int");
       level.wwx_mapvotereplay = [[level.drm_cvardef]]("wwx_map_vote_replay", 0, 0, 1, "int");
      }
      else level.wwx_mapvotemode = 0;

	//************************************************************************************************************************************************************************
	// WW2X message of the day
	//************************************************************************************************************************************************************************
	level.wwx_motdrotate = [[level.drm_cvardef]]("wwx_motd_rotate", 0, 0, 1, "int");
	level.wwx_motdrotdelay = [[level.drm_cvardef]]("wwx_motd_delay", 5, 5, 60, "int");

	//************************************************************************************************************************************************************************
	// WW2X spawn protection
	//************************************************************************************************************************************************************************
	level.wwx_spwn_time = [[level.drm_cvardef]]("wwx_protection_time", 0, 0, 60, "int");
	level.wwx_spwn_range = [[level.drm_cvardef]]("wwx_protection_range", 10, 0, 200, "int") * 12;
	level.wwx_spwn_hud = [[level.drm_cvardef]]("wwx_protection_hud", 0, 0, 1, "int");
	level.wwx_spwn_headicon = [[level.drm_cvardef]]("wwx_protection_headicon", 0, 0, 1, "int");
	level.wwx_spwn_punish_self = [[level.drm_cvardef]]("wwx_protection_punish_self",0,0,1,"int");
	level.wwx_spwn_punish_attacker = [[level.drm_cvardef]]("wwx_protection_punish_attacker",0,0,1,"int");
	level.wwx_spwn_wepdisable = [[level.drm_cvardef]]("wwx_protection_weapon_disable",0,0,1,"int");
      level.wwx_spawnpro_timer = [[level.drm_cvardef]]("wwx_sp_timer",0,0,1,"int");
      level.invisable_spawnpro = [[level.drm_cvardef]]("wwx_inv_spwn",0,0,1,"int");
	level.wwx_spwn_msg = [[level.drm_cvardef]]("wwx_protection_msg",0,0,2,"int");
	if(level.wwx_spwn_time) game["headicon_protect"] = "gfx/hud/hud@spprot_cross.tga";

	//************************************************************************************************************************************************************************
	// WW2X server message system
	//************************************************************************************************************************************************************************
	level.wwx_svrmsg = [[level.drm_cvardef]]("wwx_svrmsg", 0, 0, 10, "int");
	level.wwx_svrmsg_loop = [[level.drm_cvardef]]("wwx_svrmsg_loop", 0, 0, 1, "int");
	level.wwx_svrmsg_delay_msg = [[level.drm_cvardef]]("wwx_svrmsg_delay_msg", 30, 1, 60, "int");
	mindef = level.wwx_svrmsg * level.wwx_svrmsg_delay_msg;
	level.wwx_svrmsg_delay_main = [[level.drm_cvardef]]("wwx_server_msg_delay_main", mindef, mindef, 900, "int");
	level.wwx_svrmsg_info = [[level.drm_cvardef]]("wwx_svrmsg_info", 0, 0, 3, "int");
	level.wwx_svrmsg_rotation = [[level.drm_cvardef]]("wwx_svrmsg_rotation", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X hitblip
	//************************************************************************************************************************************************************************
	level.wwx_codhitblip = [[level.drm_cvardef]]("wwx_codhitblip",0,0,1,"int");

	//************************************************************************************************************************************************************************
	// WW2X clan confiuration - set clan name, voting status and announce status
	//************************************************************************************************************************************************************************
	level.wwx_cltag = [];
	level.wwx_clvote = [];
	level.wwx_clano = [];
	
	level.wwx_cltag[1] = [[level.drm_cvardef]]("wwx_clantag1", "clantag1", "" , "", "string");
	level.wwx_clvote[1] = [[level.drm_cvardef]]("wwx_clantag1_vote",1,0,1, "int");
	level.wwx_clano[1] = [[level.drm_cvardef]]("wwx_clantag1_announce",1,0,1, "int");

	level.wwx_cltag[2] = [[level.drm_cvardef]]("wwx_clantag2", "clantag2", "" , "", "string");
	level.wwx_clvote[2] = [[level.drm_cvardef]]("wwx_clantag2_vote",1,0,1, "int");
	level.wwx_clano[2] = [[level.drm_cvardef]]("wwx_clantag2_announce",1,0,1, "int");
	
	level.wwx_cltag[3] = [[level.drm_cvardef]]("wwx_clantag3", "clantag3", "" , "", "string");
	level.wwx_clvote[3] = [[level.drm_cvardef]]("wwx_clantag3_vote",1,0,1, "int");
	level.wwx_clano[3] = [[level.drm_cvardef]]("wwx_clantag3_announce",1,0,1, "int");
	
	level.wwx_cltag[4] = [[level.drm_cvardef]]("wwx_clantag4", "clantag4", "" , "", "string");
	level.wwx_clvote[4] = [[level.drm_cvardef]]("wwx_clantag4_vote",1,0,1, "int");
	level.wwx_clano[4] = [[level.drm_cvardef]]("wwx_clantag4_announce",1,0,1, "int");

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

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

	// Clan member welcome messages
	level.wwx_clanwelcome = [[level.drm_cvardef]]("wwx_clanwelcome", 0, 0, 1, "int");
	level.wwx_clandelay = [[level.drm_cvardef]]("wwx_clanmsgdelay", 1, 0.05, 10, "float");

	level.wwx_clan1msg = [[level.drm_cvardef]]("wwx_clan1msg", 0, 0, 3, "int");
	level.wwx_clan2msg = [[level.drm_cvardef]]("wwx_clan2msg", 0, 0, 3, "int");
	level.wwx_clan3msg = [[level.drm_cvardef]]("wwx_clan3msg", 0, 0, 3, "int");
	level.wwx_clan4msg = [[level.drm_cvardef]]("wwx_clan4msg", 0, 0, 3, "int");

	//************************************************************************************************************************************************************************
	// WW2X non clan confiuration - player welcome
	//************************************************************************************************************************************************************************
	level.wwx_pwelcome = [[level.drm_cvardef]]("wwx_pwelcome", 0, 0, 1, "int");
	level.wwx_pweldelay = [[level.drm_cvardef]]("wwx_pwelcome_delay", 1, 0, 10, "int");
	level.wwx_pwelmsg = [[level.drm_cvardef]]("wwx_pwelcome_msg", 0, 0, 3, "int");

	//************************************************************************************************************************************************************************
	// WW2X fall damage
	//************************************************************************************************************************************************************************
	if([[level.drm_cvardef]]("wwx_falldamage_enable",0,0,1,"int"))
	{
		setcvar("bg_fallDamageMaxHeight", drm_getcvarint("wwx_falldamage_max")*12);
		setcvar("bg_fallDamageMinHeight", drm_getcvarint("wwx_falldamage_min")*12);
	}

	//************************************************************************************************************************************************************************
	// WW2X hud text and settings
	//************************************************************************************************************************************************************************
	// Show hud text / mod team logo / hud settings
	level.wwx_clantext = [[level.drm_cvardef]]("wwx_clan_txt",1,0,1,"int");
	level.wwx_modtext = [[level.drm_cvardef]]("wwx_mod_txt",1,0,1,"int");
	level.wwx_hudstatsalpha = [[level.drm_cvardef]]("wwx_stats_alpha", 1.0, 0.1, 1.0, "float");
	level.wwx_hudstatsfontscale = [[level.drm_cvardef]]("wwx_stats_font_scale", 0.8, 0.5, 1.0, "float");

	// Clan logotxt
	if(level.wwx_clantext) thread scriptdata\_wwx_clanlogo::logo();

	//************************************************************************************************************************************************************************
	// WW2X team killer detection - SINBIN
	//************************************************************************************************************************************************************************
	level.wwx_sinbin = [[level.drm_cvardef]]("wwx_tksystem", 0, 0, 1, "int");
	level.wwx_sinbinmaxtk = [[level.drm_cvardef]]("wwx_tkmax", 1, 1, 10, "int");
	level.wwx_sinfrztime = [[level.drm_cvardef]]("wwx_tktime", 5, 1, 60, "int");
	level.wwx_sinbinmsg = [[level.drm_cvardef]]("wwx_tkmsg", 0, 0, 2, "int");

	//************************************************************************************************************************************************************************
	// WW2X map rotation control
	//************************************************************************************************************************************************************************
	level.wwx_pbrotate = [[level.wwx_cvardef]]("wwx_pbrotate", 0, 0, 1, "int");
	level.wwx_pbrsmall = [[level.wwx_cvardef]]("wwx_pbrsmall", 0, 0, 64, "int");
	level.wwx_pbrmedium = [[level.wwx_cvardef]]("wwx_pbrmedium", 0, 0, 64, "int");

	// Rotate map if server is empty?
	if(!isdefined(game["wwx_emptytime"])) game["wwx_emptytime"] = 0;
	level.wwx_rotateifempty = [[level.drm_cvardef]]("wwx_rotate_if_empty", 15, 0, 1440, "int");

	//************************************************************************************************************************************************************************
	// WW2X laserdot
	//************************************************************************************************************************************************************************
	level.wwx_laserdot = [[level.drm_cvardef]]("wwx_laserdot", 0, 0, 1, "float");
	if(level.wwx_laserdot)
	{
		level.wwx_laserdotsize = [[level.drm_cvardef]]("wwx_laserdot_size", 2, 1, 10, "int");
		level.wwx_laserdotred = [[level.drm_cvardef]]("wwx_laserdot_red", 0, 0, 1, "float");
		level.wwx_laserdotgreen = [[level.drm_cvardef]]("wwx_laserdot_green", 0, 0, 1, "float");
		level.wwx_laserdotblue = [[level.drm_cvardef]]("wwx_laserdot_blue", 0, 0, 1, "float");
	}

	//************************************************************************************************************************************************************************
	// WW2X killing spree and obituary system
	//************************************************************************************************************************************************************************
 	level.wwx_obrange = [[level.drm_cvardef]]("wwx_obitunit", 1, 0, 1, "int");
 	level.wwx_obituary = [[level.drm_cvardef]]("wwx_obituary", 0, 0, 8, "int");
 	level.wwx_mononame = [[level.drm_cvardef]]("wwx_mononame", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X pain and death sounds
	//************************************************************************************************************************************************************************
	level.wwx_hitsound =  [[level.drm_cvardef]]("wwx_hitsound", 0, 0, 1, "int");
	level.wwx_painsound = [[level.drm_cvardef]]("wwx_painsound", 1, 0, 1, "int");
	level.wwx_deathsound = [[level.drm_cvardef]]("wwx_deathsound", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X realism options
	//************************************************************************************************************************************************************************
	level.wwx_droponarmhit = [[level.drm_cvardef]]("wwx_droponarmhit", 0, 0, 100, "int");
	level.wwx_droponhandhit = [[level.drm_cvardef]]("wwx_droponhandhit", 0, 0, 100, "int");
	level.wwx_triponleghit = [[level.drm_cvardef]]("wwx_triponleghit", 0, 0, 100, "int");
	level.wwx_triponfoothit = [[level.drm_cvardef]]("wwx_triponfoothit", 0, 0, 100, "int");

	//************************************************************************************************************************************************************************
	// WW2X movie mode
	//************************************************************************************************************************************************************************
	level.wwx_moviemode = [[level.drm_cvardef]]("wwx_moviemode", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X player bob factor
	//************************************************************************************************************************************************************************
	level.wwx_bobfactor = [[level.drm_cvardef]]("wwx_player_bobfactor", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X health/firstaid system
	//************************************************************************************************************************************************************************
	level.wwx_callformedic = [[level.drm_cvardef]]("wwx_callformedic", 0, 0, 2, "int");
	level.wwx_showinjp = [[level.drm_cvardef]]("wwx_showinjp", 0, 0, 1, "int");
	level.wwx_showinjptime = [[level.drm_cvardef]]("wwx_showinjptime", 5, 3, 60, "float");
	level.wwx_medicall = [[level.drm_cvardef]]("wwx_medicall", 80, 0, 100, "float");
	level.wwx_minheal = [[level.drm_cvardef]]("wwx_minheal", 40, 1, 99, "int");	
	level.wwx_maxheal = [[level.drm_cvardef]]("wwx_maxheal",  level.wwx_minheal + 1, level.wwx_minheal + 1, 100, "int");	
	level.wwx_revokeonth = [[level.drm_cvardef]]("wwx_revokeonth", 30, 0, 60, "int");
	level.wwx_medicself = [[level.drm_cvardef]]("wwx_medicself", 0, 0, 1, "int");
	level.wwx_firstaidkits = [[level.drm_cvardef]]("wwx_firstaidkits", 0, 0, 9, "int");
	level.wwx_firstaid_random = [[level.drm_cvardef]]("wwx_firstaid_random", 0, 0, 1, "int");
	level.wwx_firstaidmsg = [[level.drm_cvardef]]("wwx_firstaidmsg", 0, 0, 2, "int");
	level.wwx_firstaidkitmsg = [[level.drm_cvardef]]("wwx_firstaidkitmsg", 0, 0, 1, "int");
	level.wwx_firstaidpickup = [[level.drm_cvardef]]("wwx_firstaidpickup", 0, 0, 9, "int");
	
	if(level.wwx_callformedic >= 1)
	{
		// Firstaid icon
		game["firstaidicon"] = "gfx/hud/hud@health_cross.tga";
	}

	// healthbar ( turns off health regen system )
	level.wwx_healthbar = [[level.drm_cvardef]]("wwx_healthbar", 0, 0, 1, "int");
	level.wwx_drophealth = [[level.drm_cvardef]]("wwx_drophealth", 0, 0, 1, "int");

	// if using the stock COD2 health system turn off the bleeding sounds, and set regen variables
	if((!level.wwx_healthbar || level.wwx_healthbar == 1) && level.wwx_bleeding)
	{
		level.healthOverlayCutoff = [[level.drm_cvardef]]("wwx_showinjptime", 0.45, 0, 1, "float");
		level.playerHealth_RegularRegenDelay = [[level.drm_cvardef]]("scr_regendelay", 5000, 0, 99999, "int");
		level.wwx_bleedsound = false;
	}

	// set up drophealth arrays
	if(level.wwx_drophealth)
	{
	    game["wwx_healthqueue"] = [];
	    game["wwx_healthqueuecurrent"] = 0;

		// Set up object queues
		level.wwx_objectQ["health"] = [];
		level.wwx_objectQcurrent["health"] = 0;
		level.wwx_objectQsize["health"] = 4;
	}

	//****************************************************************************
	// WW2X anti-camper system
	//****************************************************************************
	level.wwx_campwarntime = [[level.drm_cvardef]]("wwx_campwarntime", 0, 0, 300, "int");
	level.wwx_campobjtime = [[level.drm_cvardef]]("wwx_campobjtime", level.wwx_campwarntime+10, level.wwx_campwarntime+5, 600, "int");
	level.wwx_camptimer = [[level.drm_cvardef]]("wwx_camptimer", 20, 0, 300, "int");
	level.wwx_campsniper_warntime = [[level.drm_cvardef]]("wwx_campsniper_warntime", 0, 0, 600, "int");
	level.wwx_campsniper_objtime = [[level.drm_cvardef]]("wwx_campsniper_objtime", level.wwx_campsniper_warntime+10, level.wwx_campsniper_warntime+5, 1200, "int");
	level.wwx_camppunish = [[level.drm_cvardef]]("wwx_camp_punish", 0, 0, 5, "int");

	//************************************************************************************************************************************************************************
	// WW2X weapon system
	//************************************************************************************************************************************************************************
	// frag grenade loadout option
	level.wwx_frag_loadout = [[level.drm_cvardef]]("wwx_frag_loadout", 0, 0, 3, "int");

	// option 0 - stock weapon based ammo frag grenades
	level.wwx_wepo_frag_stock_sniper = [[level.drm_cvardef]]("wwx_wepo_frag_stock_sniper", 2, 0, 999, "int");
	level.wwx_wepo_frag_stock_rifle = [[level.drm_cvardef]]("wwx_wepo_frag_stock_rifle", 2, 0, 999, "int");
	level.wwx_wepo_frag_stock_mg = [[level.drm_cvardef]]("wwx_wepo_frag_stock_mg", 2, 0, 999, "int");
	level.wwx_wepo_frag_stock_smg = [[level.drm_cvardef]]("wwx_wepo_frag_stock_smg", 2, 0, 999, "int");
	level.wwx_wepo_frag_stock_shot = [[level.drm_cvardef]]("wwx_wepo_frag_stock_shot", 2, 0, 999, "int");
	level.wwx_wepo_frag_stock_rl = [[level.drm_cvardef]]("wwx_wepo_frag_stock_rl", 2, 0, 999, "int");

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

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

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

	// option 0 - stock weapon based ammo smoke grenades
	level.wwx_wepo_smoke_stock_sniper = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_sniper", 1, 0, 999, "int");
	level.wwx_wepo_smoke_stock_rifle = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_rifle", 1, 0, 999, "int");
	level.wwx_wepo_smoke_stock_mg = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_mg", 1, 0, 999, "int");
	level.wwx_wepo_smoke_stock_smg = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_smg", 1, 0, 999, "int");
	level.wwx_wepo_smoke_stock_shot = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_shot", 1, 0, 999, "int");
	level.wwx_wepo_smoke_stock_rl = [[level.drm_cvardef]]("wwx_wepo_smoke_stock_rl", 1, 0, 999, "int");

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

	// option 2 - random ammo smoke grenades
	level.wwx_wepo_smoke_random = [[level.drm_cvardef]]("wwx_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 = knives only
      // 8 = shotgun only
	level.wwx_wepo_class = [[level.drm_cvardef]]("wwx_wepo_class", 0, 0, 8, "int");

	// only class all weapons or team based weapons available
	level.wwx_wepo_team_only = [[level.drm_cvardef]]("wwx_wepo_team_only", 0, 0, 1, "int");

	// weapons limiter
	level.wwx_wepo_limiter = [[level.drm_cvardef]]("wwx_weaponlimit", 0, 0, 1, "int");

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

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

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

	// weapon enemy options
	level.wwx_wepo_enemy = [[level.drm_cvardef]]("wwx_wepo_enemy", 0, 0, 2, "int");
	level.wwx_wepo_cent = [[level.drm_cvardef]]("wwx_wepo_cent", 50, 0, 100, "int");

	// weapon loadout option
	level.wwx_wepo_loadout = [[level.drm_cvardef]]("wwx_wepo_loadout", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X weapon drop system (after death)
	//************************************************************************************************************************************************************************
	// drop weapons
	level.wwx_wepo_drop_weps = [[level.drm_cvardef]]("wwx_wepo_drop_weps", 0, 0, 4, "int");

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

	// set up drop grenades
	if(level.wwx_wepo_drop_grenades == 1)
	{
		level.wwx_wepo_drop_frag = true;
		level.wwx_wepo_drop_smoke = false;
	}
	else if(level.wwx_wepo_drop_grenades == 2)
	{
		level.wwx_wepo_drop_frag = false;
		level.wwx_wepo_drop_smoke = true;
	}
	else if(level.wwx_wepo_drop_grenades == 3)
	{
		level.wwx_wepo_drop_frag = true;
		level.wwx_wepo_drop_smoke = true;
	}
	else
	{
		level.wwx_wepo_drop_frag = false;
		level.wwx_wepo_drop_smoke = false;
	}

	//************************************************************************************************************************************************************************
	// WW2X secondary weapons system
	//************************************************************************************************************************************************************************
	level.wwx_wepo_secondary = [[level.drm_cvardef]]("wwx_wepo_secondary", 0, 0, 2, "int");

	if(level.wwx_wepo_secondary == 2) level.wwx_wepo_sec_enemy = true;
	else level.wwx_wepo_sec_enemy = false;

	// set the secondary pistol system from the sidearm settings
	if(level.wwx_wepo_sidearm == 1 || level.wwx_wepo_sidearm == 2) level.wwx_wepo_sec_pistols = true;
	else level.wwx_wepo_sec_pistols = false;

	//************************************************************************************************************************************************************************
	// WW2X weapons system overrides
	//************************************************************************************************************************************************************************
	// allow use of enemy weapons if using secondary enemy menu
	if(level.wwx_wepo_sec_enemy) level.wwx_wepo_enemy = false;

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

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

		// override team only menu if bolt action or shotgun is the weapon class
		if(level.wwx_wepo_class >= 7) level.wwx_wepo_team_only = false;

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

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

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

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

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

	}

	//************************************************************************************************************************************************************************
	// WW2X forced clientside dvars
	//************************************************************************************************************************************************************************
	level.wwx_forceclientdvars = [[level.drm_cvardef]]("wwx_forceclientdvars", 0, 0, 1, "int");
       level.wwx_forcerate = [[level.drm_cvardef]]("wwx_forcerate", 25000, 0, 99999, "int");
	level.wwx_mantlehint = [[level.drm_cvardef]]("wwx_mantlehint", 1, 0, 1, "int");
	level.wwx_crosshair = [[level.drm_cvardef]]("wwx_crosshair", 1, 0, 1, "int");
	level.wwx_crosshairnames = [[level.drm_cvardef]]("wwx_crosshairnames", 1, 0, 1, "int");
	level.wwx_enemycross = [[level.drm_cvardef]]("wwx_enemycross", 1, 0, 1, "int");
	level.wwx_hudstance = [[level.drm_cvardef]]("wwx_hudstance", 1, 0, 1, "int");
	level.wwx_brightmodels = [[level.drm_cvardef]]("wwx_brightmodels", 0, 0, 1, "int");

      //************************************************************************************************************************************************************************
      // ww2x unknown soldier handling system
      //************************************************************************************************************************************************************************
      level.wwx_uscheck = [[level.drm_cvardef]]("wwx_uscheck", 1, 0, 1, "int");
      level.wwx_usclanguest = [[level.drm_cvardef]]("wwx_usclanguest", 0, 0, 1, "int");
      level.wwx_usclanguestname = [[level.drm_cvardef]]("wwx_usclanguestname", "Guest#", "" , "", "string");
      level.wwx_usguestname = [[level.drm_cvardef]]("wwx_usguestname", "UnacceptableName#", "" , "", "string");
      level.wwx_uswarndelay1 = [[level.drm_cvardef]]("wwx_uswarndelay1", 30, 20, 60, "int");
      level.wwx_uswarndelay2 = [[level.drm_cvardef]]("wwx_uswarndelay2", 30, 20, 120, "int");	
      level.wwx_uspunishcount = [[level.drm_cvardef]]("wwx_uspunishcount", 5, 1, 999, "int");	

	//************************************************************************************************************************************************************************
	// WW2X sprint system
	//************************************************************************************************************************************************************************
	level.wwx_sprint = [[level.drm_cvardef]]("wwx_sprint",0,0,3,"int");
	level.wwx_sprinttime = [[level.drm_cvardef]]("wwx_sprint_time",3,1,999,"int") * 20;
	level.wwx_sprintrecovertime = [[level.drm_cvardef]]("wwx_sprint_recover_time",2,0,999,"int") * 20;
	level.wwx_sprinthud = [[level.drm_cvardef]]("wwx_sprint_hud",1,0,1,"int");
	level.wwx_sprinthudhint = [[level.drm_cvardef]]("wwx_sprint_hud_hint",1,0,1,"int");
      level.wwx_sprintheavyflag = [[level.drm_cvardef]]("wwx_sprint_heavy_flag",0,0,1,"int");

	//************************************************************************************************************************************************************************
	// WW2X gravity and game speed overrides
	//************************************************************************************************************************************************************************
	if([[level.drm_cvardef]]("wwx_gravity",100,0,9999,"int") != 100) setcvar("g_gravity", 8 * [[level.drm_cvardef]]("wwx_gravity",100,0,9999,"int"));
	if([[level.drm_cvardef]]("wwx_speed",100,0,9999,"int") != 100) setcvar("g_speed", int(1.9 * [[level.drm_cvardef]]("wwx_speed",100,0,9999,"int")) );

	//************************************************************************************************************************************************************************
	// WW2X statsboard
	//************************************************************************************************************************************************************************
	level.wwx_stbd = [[level.drm_cvardef]]("wwx_stbd",0,0,1,"int");
	if(level.wwx_stbd)
	{
		level.wwx_stbd_kd = [[level.drm_cvardef]]("wwx_stbd_kd", 1, 0, 1, "int");
		level.wwx_stbd_se = [[level.drm_cvardef]]("wwx_stbd_se", 1, 0, 1, "int");
		level.wwx_stbd_tps = [[level.drm_cvardef]]("wwx_stbd_tps", 0, 0, 10, "int");
		level.wwx_stbd_time = [[level.drm_cvardef]]("wwx_stbd_time", 20, 0, 120, "int");
		level.wwx_stbd_icons = [[level.drm_cvardef]]("wwx_stbd_icons", 0, 0, 1, "int");
		level.wwx_stbd_movex = [[level.drm_cvardef]]("wwx_stbd_movex", 0, 0, 150, "int");
		level.wwx_stbd_fade = [[level.drm_cvardef]]("wwx_stbd_fade", 0, 0, 1, "int");
		level.wwx_stbd_log = [[level.drm_cvardef]]("wwx_stbd_log", 0, 0, 1, "int");
		if(!level.wwx_stbd_kd && !level.wwx_stbd_se) level.wwx_stbd = 0;
	}
	//************************************************************************************************************************************************************************
	// WW2X ambient planes
	//************************************************************************************************************************************************************************
	level.wwx_planes = [[level.drm_cvardef]]("wwx_planes", 0, 0, 3, "int");
	level.wwx_planes_min = [[level.drm_cvardef]]("wwx_planes_min", 1, 1, 19, "int");
	level.wwx_planes_max = [[level.drm_cvardef]]("wwx_planes_max", level.wwx_planes_min + 1, level.wwx_planes_min + 1, 20, "int");
	level.wwx_planes_delay_min = [[level.drm_cvardef]]("wwx_planes_delay_min", 60, 30, 720, "int");
	level.wwx_planes_delay_max = [[level.drm_cvardef]]("wwx_planes_delay_max", level.wwx_planes_delay_min + 1, level.wwx_planes_delay_min + 1, 1440, "int");
	level.wwx_planes_flak = [[level.drm_cvardef]]("wwx_planes_flak", 0, 0, 1, "int");
	level.wwx_planes_altitude = [[level.drm_cvardef]]("wwx_planes_altitude", 1400, 0, 6000, "int");
      level.wwx_air_raid = [[level.drm_cvardef]]("wwx_air_raid", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X ambient mortars
	//************************************************************************************************************************************************************************
	level.wwx_mortars = [[level.drm_cvardef]]("wwx_mortars", 0, 0, 2, "int");
	level.wwx_mortars_alert = [[level.drm_cvardef]]("wwx_mortars_alert", 0, 0, 1, "int");
	level.wwx_mortars_min = [[level.drm_cvardef]]("wwx_mortars_min", 10, 1, 24, "int");
	level.wwx_mortars_max = [[level.drm_cvardef]]("wwx_mortars_max", level.wwx_mortars_min + 1, level.wwx_mortars_min + 1, 25, "int");
	level.wwx_mortars_delay_min = [[level.drm_cvardef]]("wwx_mortars_delay_min", 60, 30, 1440, "int");
	level.wwx_mortars_delay_max = [[level.drm_cvardef]]("wwx_mortars_delay_max", level.wwx_mortars_delay_min + 1, level.wwx_mortars_delay_min + 1, 1440, "int");

	//************************************************************************************************************************************************************************
	// WW2X turret abuse
	//************************************************************************************************************************************************************************
	level.wwx_turretabuse	= [[level.drm_cvardef]]("wwx_turretabuse", 0, 0, 20, "int");
	level.wwx_turretabusepc	= [[level.drm_cvardef]]("wwx_turretabuse_pc", 0, 0, 100, "int");	

	//************************************************************************************************************************************************************************
	// WW2X sky fx
	//************************************************************************************************************************************************************************
	// tracer fx
	level.wwx_tracers = [[level.drm_cvardef]]("wwx_tracers", 0, 0, 10, "int");

	if(level.wwx_tracers)
	{
		level.wwx_tracersdelaymin = [[level.drm_cvardef]]("wwx_tracers_delay_min", 10, 5, 720, "int");
		level.wwx_tracersdelaymax = [[level.drm_cvardef]]("wwx_tracers_delay_max", level.wwx_tracersdelaymin + 1, level.wwx_tracersdelaymin + 1, 1440, "int");
		level.wwx_tracers_sound = [[level.drm_cvardef]]("wwx_tracers_sound", 0, 0, 1, "int");
	}

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

	if(level.wwx_flakfx)
	{
		level.wwx_flakfxdelaymin = [[level.drm_cvardef]]("wwx_flakfx_delay_min", 5, 5, 720, "int");
		level.wwx_flakfxdelaymax = [[level.drm_cvardef]]("wwx_flakfx_delay_max", level.wwx_flakfxdelaymin + 1, level.wwx_flakfxdelaymin + 1, 1440, "int");
	}

	// flak settings if plane flak enabled
	if(level.wwx_planes_flak || level.wwx_ranksystem)
	{
		if(level.wwx_flakfx < 10) level.wwx_flak = 10;
		level.wwx_flakfxdelaymin = 5;
		level.wwx_flakfxdelaymax = 15;
	}

	//************************************************************************************************************************************************************************
	// WW2X pop helmet/head system
	//************************************************************************************************************************************************************************
	// helmet pop
	level.wwx_pophelmet = [[level.drm_cvardef]]("wwx_pophelmet", 50, 0, 100, "int");

	// head pop
	level.wwx_pophead = [[level.drm_cvardef]]("wwx_pophead", 0, 0, 100, "int");
	level.wwx_popheadbullet = [[level.drm_cvardef]]("wwx_pophead_bullet", 0, 0, 1, "int");
	level.wwx_popheadmelee = [[level.drm_cvardef]]("wwx_pophead_melee", 0, 0, 1, "int");
	level.wwx_popheadexplosion = [[level.drm_cvardef]]("wwx_pophead_explosion", 0, 0, 1, "int");

	if(level.wwx_pophelmet)
	{
		// Set up object queues
		level.wwx_objectQ["helmet"] = [];
		level.wwx_objectQcurrent["helmet"] = 0;
		level.wwx_objectQsize["helmet"] = 8;
	}

	if(level.wwx_pophead)
	{
		// Set up object queues
		level.wwx_objectQ["head"] = [];
		level.wwx_objectQcurrent["head"] = 0;
		level.wwx_objectQsize["head"] = 4;
	}

	//************************************************************************************************************************************************************************
	// WW2X coloured smoke grenades
	//************************************************************************************************************************************************************************
	level.wwx_smoke["american"] = [[level.drm_cvardef]]("wwx_american_smoke", 0, 0, 11, "int");
	level.wwx_smoke["british"] = [[level.drm_cvardef]]("wwx_british_smoke", 0, 0, 11, "int");
	level.wwx_smoke["russian"] = [[level.drm_cvardef]]("wwx_russian_smoke", 0, 0, 11, "int");
	level.wwx_smoke["german"] = [[level.drm_cvardef]]("wwx_german_smoke", 0, 0, 11, "int");

	//************************************************************************************************************************************************************************
	// WW2X command monitor
	//************************************************************************************************************************************************************************
	level.wwx_cmdmonitor = [[level.drm_cvardef]]("wwx_cmd_monitor", 0, 0, 1, "int");
	level.wwx_cmdmonitor_models = [[level.drm_cvardef]]("wwx_cmdmonitor_models", 0, 0, 1, "int");

	//************************************************************************************************************************************************************************
	// WW2X player model limiter
	//************************************************************************************************************************************************************************
	level.wwx_american_normandy = [[level.drm_cvardef]]("wwx_american_normandy", 10, 1, 10, "int");
	level.wwx_british_africa = [[level.drm_cvardef]]("wwx_british_africa", 5, 1, 5, "int");
	level.wwx_british_normandy =  [[level.drm_cvardef]]("wwx_british_africa", 6, 1, 6, "int");
	level.wwx_german_winterdark = [[level.drm_cvardef]]("wwx_german_winterdark", 2, 1, 2, "int");
	level.wwx_russian_coat = [[level.drm_cvardef]]("wwx_russian_coat",4, 1, 4, "int");
	level.wwx_russian_padded = [[level.drm_cvardef]]("wwx_russian_padded", 2, 1, 2, "int");

	//************************************************************************************************************************************************************************
	// WW2X WMD explosion control options
	//************************************************************************************************************************************************************************
	// radius control
	level.wwx_planecrash_radius = 12 * [[level.drm_cvardef]]("wwx_planecrash_radius",0, 1, 999, "int");
	level.wwx_planebomb_radius = 12 * [[level.drm_cvardef]]("wwx_planebomb_radius",0, 1, 999, "int");
	level.wwx_artillery_radius = 12 * [[level.drm_cvardef]]("wwx_artillery_radius",0, 1, 999, "int");
	level.wwx_mortar_radius = 12 * [[level.drm_cvardef]]("wwx_mortar_radius",0, 1, 999, "int");

	//************************************************************************************************************************************************************************
	// WW2X+ weather FX
	//************************************************************************************************************************************************************************
	// WW2X rain fx
	rainfx = [[level.drm_cvardef]]("wwx_rainfx", 0, 0, 100, "int");
	if(randomInt(100) < rainfx) level.wwx_rainfx = true;
	else level.wwx_rainfx = false;

	// WW2X thunder and lightning fx
	tlfx = [[level.drm_cvardef]]("wwx_tlfx", 0, 0, 100, "int");
	if(randomInt(100) < rainfx) level.wwx_tlfx = true;
	else level.wwx_tlfx = false;

	if(level.wwx_rainfx)
	{
		thread ww2x\_wwx_weather::rainControl();
		if(level.wwx_tlfx) thread ww2x\_wwx_weather::lightningThink();
	}

	// WW2X fog
	level.wwx_efogstr = [[level.drm_cvardef]]("wwx_efog", "none", "", "", "string");

	//************************************************************************************************************************************************************************
	// WW2X ammo crates
	//************************************************************************************************************************************************************************
	level.wwx_amc_perteam = [[level.drm_cvardef]]("wwx_amc_perteam",0, 0, 8, "int");
	level.wwx_amc_msg = [[level.drm_cvardef]]("wwx_amc_msg",0, 0, 3, "int");

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

	// precache strings
	thread preacachestrings();

	// preache headicons
	thread precacheheadicons();

	// precache shaders
	thread precacheshaders();

	// precache models
	thread precachemodels();

	//************************************************************************************************************************************************************************
	// WW2X end of pre-map configuration
	//************************************************************************************************************************************************************************
}

// for variables and precaching that require team parameters
postmapload()
{
	//************************************************************************************************************************************************************************
	// WW2X serverinfo (main starting screen)
	//************************************************************************************************************************************************************************
	thread ww2x\_wwx_serverinfo::main();

	//************************************************************************************************************************************************************************
	// WW2X 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");

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

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

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

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

	// postmapload preachestrings
	thread postmapload_precachestrings();

	// postmapload preachestrings
	thread postmapload_precacheshaders();

	//************************************************************************************************************************************************************************
	// WW2X end of post-map configuration
	//************************************************************************************************************************************************************************
}

loadeffects()
{
	if(level.wwx_turretabuse || (!level.wwx_camppunish || level.wwx_camppunish == 2)) level.wwx_effect["blowthefag"] = loadfx("fx/explosions/matmata_plane_explosion.efx");

	if(level.wwx_flakfx >=1 || level.wwx_planes_flak || level.wwx_ranksystem)
	{
		// flak fx
		level.wwx_effect["flak_smoke"]	= loadfx("fx/explosions/flak_puff.efx");
		level.wwx_effect["flak_flash"]		= loadfx("fx/explosions/default_explosion.efx");
		level.wwx_effect["flak_dust"]		= loadfx("fx/dust/flak_dust_blowback.efx");
	}

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

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

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

	if(level.wwx_ranksystem)
	{
		// artillery effects
		level.wwx_effect["artillery"] = loadfx("fx/props/barrelexp.efx");
	}

	if(level.wwx_planes || level.wwx_ranksystem)
	{
		level.wwx_effect["plane_smoke"]			= loadfx("fx/fire/fire_airplane_trail.efx");
		level.wwx_effect["plane_explosion"]		= loadfx("fx/explosions/matmata_plane_explosion.efx");
		level.wwx_effect["planecrash_fire"]			= loadfx("fx/fire/building_fire_med.efx");
		level.wwx_effect["planecrash_smoke"]	= loadfx("fx/smoke/thin_black_smoke_M.efx");
		level.wwx_effect["planecrash_ball"]		= loadfx("fx/smoke/battlefield_smokebank_S.efx");

		//napalm
		level.wwx_effect["napalm_bomb"] = loadfx("fx/ww2x_napalm/napalm.efx");

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

		if(level.wwx_ranksystem && level.wwx_rank_wmd_flare) level.wwx_effect["flare_indicator"] = loadfx("fx/misc/flare_artillery_runner.efx");
	}

	if(level.wwx_ranksystem || level.wwx_tweapon) level.wwx_effect["plane_bomb"] = loadfx("fx/explosions/spitfire_bomb_dirt.efx");

	if((level.wwx_campwarntime || level.wwx_campsniper_warntime) && (!level.wwx_camppunish || level.wwx_camppunish == 2)) level.wwx_effect["fartbomb"] = loadfx("fx/fart/fartsmoke.efx");

	level.wwx_effect["pophead"]		= loadfx("fx/impacts/flesh_hit.efx");
	level.wwx_effect["blowplayer"]	= loadfx("fx/props/barrelexp.efx");
	level.wwx_effect["bleeding"]		= loadfx("fx/impacts/bleeding_hit.efx");
	level.wwx_effect["artillery"]	= loadfx("fx/props/barrelexp.efx");
	level.wwx_effect["playerburn"] = loadfx("fx/fire/character_torso_fire.efx");
	level.wwx_effect["playerburn2"] = loadfx("fx/fire/character_arm_fire.efx");
	level.wwx_effect["puke"] = loadfx ("fx/misc/vomit.efx");
	level.wwx_effect["fire"] = loadfx ("fx/impacts/molotov_blast.efx");
	level.wwx_effect["gas"] = loadfx ("fx/impacts/mustard_blast.efx");
	//level.wwx_effect["sticky"] = loadfx ("fx/explosions/default_explosion.efx");
	level.wwx_effect["satchel"] = loadfx ("fx/explosions/barn_explosion.efx");

}

preacachestrings()
{
	// Server redirection
  if(level.wwx_redirect)
  {
    [[level.wwx_PrecacheString]](&"REDIRECT_TITLE");
    [[level.wwx_PrecacheString]](&"REDIRECT_TIMELEFT");
    [[level.wwx_PrecacheString]](&"REDIRECT_REASON_ISPRIVATE");
    [[level.wwx_PrecacheString]](&"REDIRECT_REASON_ISFULL");
    [[level.wwx_PrecacheString]](&"REDIRECT_REASON_ISOLD");
    [[level.wwx_PrecacheString]](&"REDIRECT_REASON_ISSERVICED");
    [[level.wwx_PrecacheString]](&"REDIRECT_REASON_CLANPRIORITY");
    [[level.wwx_PrecacheString]](&"REDIRECT_CLAN_FREEUPSLOT");
    [[level.wwx_PrecacheString]](&"REDIRECT_CLAN_ABORTED");
    [[level.wwx_PrecacheString]](&"REDIRECT_CLAN_PLEASEWAIT");
    [[level.wwx_PrecacheString]](&"REDIRECT_CLAN_CONTINUE");
    [[level.wwx_PrecacheString]](&"REDIRECT_TO_PUBLICSERVER");
    [[level.wwx_PrecacheString]](&"REDIRECT_TO_OTHERSERVER");
    [[level.wwx_PrecacheString]](&"REDIRECT_TO_NEWSERVER");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_REMFROMFAV");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_ADDTOFAV");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_VISITWEBSITE");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_SORRY");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_PRIORITY");
    [[level.wwx_PrecacheString]](&"REDIRECT_HINT_WW2X");
  }

	// round based gametype round number text
	if(level.wwx_roundbased)
	{
		[[level.wwx_PrecacheString]](&"WELCOME_ROUNDNUMBER");
		[[level.wwx_PrecacheString]](&"WELCOME_LASTROUND");
	}

	if(level.wwx_rangefinder)
       {
		[[level.wwx_PrecacheString]](&"MISC_RANGE");
		[[level.wwx_PrecacheString]](&"MISC_RANGE2");
       }

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

	if(level.wwx_gtsdelay)
	{
		[[level.wwx_PrecacheString]](&"GTSDELAY_WAITING_PLAYERS");
		[[level.wwx_PrecacheString]](&"GTSDELAY_MATCH_BEGINS");
	}		

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

	if(level.wwx_stbd)
	{
		//Statsboard title
		[[level.wwx_PrecacheString]](&"CUSTOM_TITLES");
		[[level.wwx_PrecacheString]](&"STATSBOARD_HOWTO");
		[[level.wwx_PrecacheString]](&"STATSBOARD_TIMELEFT");
		[[level.wwx_PrecacheString]](&"STATSBOARD_PLAYERLEFT");

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

		//Statsboard score and efficiency
		if(level.wwx_stbd_se)
		{
			[[level.wwx_PrecacheString]](&"STATSBOARD_HEADER_SE");
			[[level.wwx_PrecacheString]](&"STATSBOARD_SCORE_EFFICIENCY");
		}
	}

	// sprint
	if(level.wwx_sprint && level.wwx_sprinthudhint) [[level.wwx_PrecacheString]](&"SPRINT_HINT");

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

	if(level.wwx_callformedic)
	{
		[[level.wwx_PrecacheString]](&"FIRSTAID_MEDI");
		[[level.wwx_PrecacheString]](&"FIRSTAID_DISABLED");
	}

	// Tripwire messages
	if(level.wwx_tweapon)
	{
		[[level.wwx_PrecacheString]](&"TRIPWIRE_CHOOSE_GRENADE");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_FRAG_HOLD_SMOKE");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_SMOKE_HOLD_CANCEL");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_DEFUSE");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_PLANT");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_DEFUSING");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_PLANTING");
		[[level.wwx_PrecacheString]](&"TRIPWIRE_ACTIVATE");

		// tripwire sniper messages
		[[level.wwx_PrecacheString]](&"TRIPWIRE_CHANGE_SNIPER");
		[[level.wwx_PrecacheString]](&"TURRETS_PICKUP");
		if(level.wwx_wepo_class == 2 && !level.wwx_wepo_sidearm) [[level.wwx_PrecacheString]](&"TRIPWIRE_SNIPER_ONLY");
	}

if(level.wwx_mapvote || level.wwx_svrmsg_info)
  {
    // Pre-cache map voting string for extended map voting system
    [[level.wwx_PrecacheString]](&"MAPROTATION_CUSTOM_NEXT");
    [[level.wwx_PrecacheString]](&"MAPROTATION_NEXT_MAP");
    [[level.wwx_PrecacheString]](&"MAPROTATION_NEXT_GT");
    [[level.wwx_PrecacheString]](&"MAPROTATION_TITLE");
    [[level.wwx_PrecacheString]](&"CUSTOM_TITLE");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_HEADERS");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_HOWTO");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_TIMELEFT");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_INPROGRESS");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_NOTALLOWED");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PLEASEWAIT");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1OF1");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1OF2");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1OF3");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1OF4");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE1OF5");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE2OF2");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE2OF3");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE2OF4");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE2OF5");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE3OF3");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE3OF4");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE3OF5");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE4OF4");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE4OF5");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_PAGE5OF5");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_REPLAY");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_INFORM");    
    [[level.wwx_PrecacheString]](&"MAPVOTE_WINNER");
          
    // Pre-cache game types for extended map voting system
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_CLASSIC_HEADQUARTERS");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_CONQUEST");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_CAPTURE_THE_FLAG");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_CAPTURE_THE_FLAG_BACK");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_DEATHMATCH");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_DOMINATION");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_ENHANCED_SD");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_HEADQUARTERS");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_HOLD_THE_FLAG");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_I_HOLD_THE_FLAG");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_LIBERATION");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_LAST_MAN_STANDING");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_LAST_TEAM_STANDING");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_ONSLAUGHT");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_SEARCH_AND_DESTROY");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_TEAM_DEATHMATCH");
    [[level.wwx_PrecacheString]](&"CUSTOM_GT_VERY_IMPORTANT_PERSON");

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

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

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

	// mod text
	if(level.wwx_modtext)
	{
		[[level.wwx_PrecacheString]](&"CUSTOM_MESSAGE_NAME");
		[[level.wwx_PrecacheString]](&"CUSTOM_MESSAGE_BY");
		[[level.wwx_PrecacheString]](&"CUSTOM_MESSAGE_WEBSITE");
	}

	// Clan logotxt
	if(level.wwx_clantext) [[level.wwx_PrecacheString]](level.wwx_clanlotxt);

	if(level.wwx_sinbin)
	{
		[[level.wwx_PrecacheString]](&"SINBIN_FREEZE");
		[[level.wwx_PrecacheString]](&"SINBIN_FREEFALL");
	}

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

precacheshaders()
{
	// landmines
	if(level.wwx_landmines)
		[[level.wwx_PrecacheShader]]("gfx/custom/bblandhud2.tga");

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

	// logos
	if(level.wwx_logopic)
	{
		[[level.wwx_PrecacheShader]]("gfx/custom/logo_wcex.tga");
		[[level.wwx_PrecacheShader]]("gfx/custom/logo_cod.tga");
	}

	// statsboard
	//if(level.wwx_stbd) [[level.wwx_PrecacheShader]]("gfx/custom/ww2x_statsboard_title.tga");

	// tripwires
	if(level.wwx_tweapon)
	{
		[[level.wwx_PrecacheShader]]("hud_us_smokegrenade_C");
		[[level.wwx_PrecacheShader]]("killiconsuicide");
	}

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

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

	if(level.wwx_healthbar || level.wwx_sprint)
	{
		[[level.wwx_PrecacheShader]]("gfx/hud/hud@health_back.tga");
		[[level.wwx_PrecacheShader]]("gfx/hud/hud@health_bar.tga");
	}

	if(level.wwx_healthbar || level.wwx_callformedic) [[level.wwx_PrecacheShader]]("gfx/hud/hud@health_cross.tga");

	if(level.wwx_codhitblip) [[level.wwx_PrecacheShader]]("gfx/reticle/mg42_cross.tga");

	if(level.wwx_ranksystem)
	{
		[[level.wwx_PrecacheShader]](game["mortar"]);
		[[level.wwx_PrecacheShader]](game["artillery"]);
		[[level.wwx_PrecacheShader]](game["airstrike"]);
	}

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

precachemodels()
{
	if(level.wwx_mortars >= 1) [[level.wwx_PrecacheModel]]("xmodel/prop_mortar");

	if(level.wwx_drophealth)
	{
		[[level.wwx_PrecacheModel]]("xmodel/health_small");
		[[level.wwx_PrecacheModel]]("xmodel/health_medium");
		[[level.wwx_PrecacheModel]]("xmodel/health_large");
	}

	if(level.wwx_planes || level.wwx_ranksystem)
	{
		[[level.wwx_PrecacheModel]]("xmodel/vehicle_stuka_flying");
		[[level.wwx_PrecacheModel]]("xmodel/vehicle_spitfire_flying");
		[[level.wwx_PrecacheModel]]("xmodel/vehicle_p51_mustang");
		[[level.wwx_PrecacheModel]]("xmodel/vehicle_condor");
		[[level.wwx_PrecacheModel]]("xmodel/prop_stuka_bomb");
	}

	// Precache parachute
	if(level.wwx_parachutes) [[level.wwx_PrecacheModel]]("xmodel/am_fallschirm");

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

	if(level.wwx_amc_perteam)
	{
		[[level.wwx_PrecacheModel]]("xmodel/prop_crate_smallshipping_open1");
		[[level.wwx_PrecacheModel]]("xmodel/prop_mortar_crate2");
	}

	// landmines
	if(level.wwx_landmines)
		[[level.wwx_PrecacheModel]]("xmodel/bblandmine");

}

precacheheadicons()
{
	if(level.wwx_spwn_time) [[level.wwx_PrecacheHeadIcon]](game["headicon_protect"]);
}

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

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

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

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

	}
}

postmapload_precacheshaders()
{
	// Tripwires
	if(level.wwx_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.wwx_precacheShader]](grenadeicon);
		[[level.wwx_PrecacheShader]]("gfx/icons/hud@steilhandgrenate_C.tga");
		[[level.wwx_PrecacheShader]]("gas_grenade");
		[[level.wwx_PrecacheShader]]("gfx/icons/hud@incenhandgrenade_c.tga");
		[[level.wwx_PrecacheShader]]("gfx/icons/hud@stickie_xplsive.tga");
		[[level.wwx_PrecacheShader]]("gfx/custom/satchelkill.tga");

	}

	if(level.wwx_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.wwx_PrecacheShader]](logo);
		[[level.wwx_PrecacheShader]]("gfx/custom/logo_german.tga");
	}

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

		[[level.wwx_PrecacheShader]]("objective_german");
	}
	
	[[level.wwx_precacheShader]](game["headicon_allies"]);
	[[level.wwx_precacheShader]](game["headicon_axis"]);
	[[level.wwx_precacheShader]]("hud_status_dead");
}

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

	// coldbreath FX
	if(level.wwx_wintermap && level.wwx_coldbreathfx) level.wwx_effect["coldbreathfx"] = loadfx ("fx/misc/cold_breath.efx");

	// wintermap explosionfx
	if(level.wwx_wintermap) 	level.wwx_effect["explosion_snow"] = loadfx("fx/explosions/grenadeExp_snow.efx");
}

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