// * AdmiralMOD by Matthias Lorenz, http://www.cod2mod.com *


Precache() {


	if(game["am_enabled"] != 1) return;

	if(isDefined(game["am_precached_done"])) return;


	if(game["am_error_logfile"] == 1) logPrint("Precache\n");



	// * Zombie Maske Precache *
	if(game["am_gametype"] == "noz" || game["am_gametype"] == "csd") {

		precacheModel("xmodel/head_german_africa_mask");
	}
	

	if(game["am_use_player_class_system"] == 0 && game["am_parachute"] == 1) {
	
		precacheModel("xmodel/am_fallschirm");
	}


	if(game["am_use_player_class_system"] == 1) {
	
		precacheModel("xmodel/am_fallschirm");
		precacheModel("xmodel/crate01");
		precacheModel("xmodel/prop_crate_wehrmacht2a"); 
		precacheModel("xmodel/am_messer");
		precacheModel("xmodel/prop_mortar");
		precacheModel("xmodel/prop_mortar_ammunition");	

		precacheItem("fire_grenade_mp");
		precacheItem("gas_grenade_mp");
		precacheItem("knife_mp");
		precacheItem("tnt_bomb_mp");

		precacheItem("mortar_cannon_walk_mp");
		precacheItem("mortar_cannon_stand_mp");
		
		game["fire_grenade_explode_fx"] = loadfx("fx/impacts/fire_grenade_explode.efx");
		game["fire_grenade_fx"] 		= loadfx("fx/impacts/fire_grenade_fx.efx");
		game["fire_grenade_fx2"] 		= loadfx("fx/impacts/fire_grenade_fx_part_2.efx");
		game["fire_grenade_fx3"] 		= loadfx("fx/impacts/fire_grenade_fx_part_3.efx");
		game["fire_grenade_fx4"] 		= loadfx("fx/impacts/fire_grenade_fx_part_4.efx");
		
		game["gas_grenade_fx"] 			= loadfx("fx/props/yellow_smoke_grenade_fx.efx");
		game["gas_grenade_fx2"] 		= loadfx("fx/props/yellow_smoke_grenade_fx2.efx");
		game["gas_grenade_fx3"] 		= loadfx("fx/props/yellow_smoke_grenade_fx3.efx");
		game["gas_grenade_fx4"] 		= loadfx("fx/props/yellow_smoke_grenade_fx4.efx");
		
		
		game["mortar_flash_fx"] 		= loadfx("fx/muzzleflashes/mortar_flash.efx");
		
		precacheShellshock("shellshock_fire");		
		precacheShellshock("shellshock_gas");	
		
		game["body_burn_fx"] 			= loadfx("fx/fire/fire_body.efx");
		game["body_burn_torso_fx"] 		= loadfx("fx/fire/fire_torso.efx");
	}


	precacheShader("black");
	precacheShader("white");
    
	precacheShader("gfx/custom/hud@fire_ready.tga"); 

	precacheShader("objective_german");
	if(game["allies"] == "russian") 	precacheShader("objective_russian");
	if(game["allies"] == "british") 	precacheShader("objective_british");
	if(game["allies"] == "american") 	precacheShader("objective_american");


	precacheShader("objective");
	precacheShader("objpoint_star");
	precacheShader("objpoint_radio"); // * für Camping auf Compass *


	// * das kann weg *
	precacheShader("gfx/hud/death_suicide.tga");
	precacheShader("gfx/icons/hud@tt30.tga");
	
	
	
	precacheShader("gfx/icons/hint_usable");

	

	precacheShader("gfx/custom/empty.tga");
	precacheShader("clanlogo.tga");
	


	precacheShader("hudStopwatch");

	
	if(game["am_use_player_class_system"] == 1) {

		precacheShader("am_compass_medic");
		precacheShader("am_crate");
		
		precacheShader("gfx/custom/compass_spy_point.tga");			
	}
	
	
	if(game["am_use_player_class_system"] == 1 && game["am_show_rank_icons_in_highscore"] == 0) {

		precacheStatusIcon("gfx/custom/hud@medic.tga");
		precacheStatusIcon("gfx/custom/tnt_bomb.tga");		
		precacheStatusIcon("gfx/custom/hud@artillery.tga");
		precacheStatusIcon("gfx/custom/hud@spy.tga");
	}
	
	if((game["am_enable_player_rank"] == 1 && game["am_use_player_class_system"] == 0) || (game["am_enable_player_rank"] == 1 && game["am_use_player_class_system"] == 1 && game["am_show_rank_icons_in_highscore"] == 1)) {

		precacheStatusIcon("gfx/custom/hud@us_rank1.tga");	
		precacheStatusIcon("gfx/custom/hud@us_rank2.tga");
		precacheStatusIcon("gfx/custom/hud@us_rank3.tga");
		precacheStatusIcon("gfx/custom/hud@us_rank4.tga");
		precacheStatusIcon("gfx/custom/hud@us_rank5.tga");
	}


	if(game["am_enable_player_rank"] == 1) {
	
		precacheHeadIcon("gfx/custom/hud@us_rank1.tga");	
		precacheHeadIcon("gfx/custom/hud@us_rank2.tga");
		precacheHeadIcon("gfx/custom/hud@us_rank3.tga");
		precacheHeadIcon("gfx/custom/hud@us_rank4.tga");
		precacheHeadIcon("gfx/custom/hud@us_rank5.tga");
	}
	
	

	if(game["am_grenade_return_throw"] == 1) precacheShader("gfx/custom/obj_pickup.tga");
	
	

	if(game["am_enable_weapon_enfield_for_american"] == 1) precacheItem("enfield_mp");


		

	if(game["am_player_sprinting"] == 1) {

		
		if(game["allies"] == "russian") 	precacheItem("am_TT30_mp");
		if(game["allies"] == "british") 	precacheItem("am_webley_mp");
		if(game["allies"] == "american") 	precacheItem("am_colt_mp");	
		
		precacheItem("am_luger_mp");
		
		precacheItem("am_m1carbine_mp");
		precacheItem("am_m1garand_mp");
		precacheItem("am_thompson_mp");
		precacheItem("am_bar_mp");
		precacheItem("am_springfield_mp");
		precacheItem("am_greasegun_mp");
		precacheItem("am_enfield_mp");
		precacheItem("am_sten_mp");
		precacheItem("am_bren_mp");
		precacheItem("am_enfield_scope_mp");
		precacheItem("am_m1garand_mp");
		precacheItem("am_thompson_mp");
		precacheItem("am_mosin_nagant_mp");
		precacheItem("am_SVT40_mp");
		precacheItem("am_PPS42_mp");
		precacheItem("am_ppsh_mp");
		precacheItem("am_mosin_nagant_sniper_mp");
		precacheItem("am_shotgun_mp");
		precacheItem("am_g43_mp");
		precacheItem("am_mp40_mp");
		precacheItem("am_mp44_mp");
		precacheItem("am_kar98k_mp");
		precacheItem("am_kar98k_sniper_mp");
		precacheItem("am_shotgun_mp");
		precacheItem("am_sprintnoweapon_mp");
	

		precacheShader("gfx/custom/stance_stand_schablone.tga");
		precacheShader("gfx/custom/stance_stand_man.tga");
		precacheShader("gfx/custom/stance_crouch_schablone.tga");
		precacheShader("gfx/custom/stance_prone_schablone.tga");
		precacheShader("gfx/custom/stance_sprint_schablone.tga");
		precacheShader("gfx/custom/stance_sprint_man.tga");
	}



	if(game["am_use_player_class_system"] == 1 && game["allies"] == "russian") {
			
		precacheItem("bar_mp");
	}

		
		
	

	if(game["am_health_drop"] == 1) {

		precacheModel("xmodel/health_small");
		precacheModel("xmodel/health_medium");
		precacheModel("xmodel/health_large");
	}

	if(game["am_boats"] == 1) {

		precacheModel("xmodel/vehicle_higgins_vm");
		precacheModel("xmodel/vehicle_higgins_destroyed");
		precacheModel("xmodel/vehicle_higgins_mortors");
		precacheModel("xmodel/vehicle_higgins_mortors_destroyed");
		precacheModel("xmodel/vehicle_higgins_grapple_hook");
		precacheModel("xmodel/vehicle_higgins_grapple_rope_short_l");
		precacheModel("xmodel/vehicle_higgins_grapple_rope_short_r");		
	}
	



	
	
	//precacheModel("xmodel/vehicle_condor");	
	//precacheModel("xmodel/railpipe_d01");	
	
	precacheModel("xmodel/vehicle_stuka_flying");	
	
	
	
	
	precacheModel("xmodel/vehicle_halftrack_rockets_shell_d");	
	precacheModel("xmodel/helmet_us_wet_ranger_medic_wells");	


	if(game["am_gametype"] == "mm" || game["am_use_player_class_system"] == 1) {
	
		precacheModel("xmodel/mp_tntbomb");	
		precacheModel("xmodel/mp_tntbomb_obj");
	}

	if(game["am_enable_mobile_mg"] == 1) {

		precacheItem("30cal_walk_mp");
		precacheItem("30cal_stand_mp");
		precacheItem("30cal_duck_mp");
		precacheItem("30cal_prone_mp");
		precacheItem("mg42_bipod_walk_mp");
		precacheItem("mg42_bipod_stand_mp");
		precacheItem("mg42_bipod_duck_mp");
		precacheItem("mg42_bipod_prone_mp");

		precacheModel("xmodel/weapon_30cal");
		precacheModel("xmodel/weapon_mg42");
	}


	precacheString(game["am_clan_logo_text"]);	


	if(game["am_secondary_weapon"] == 1) precacheString(&"AM_MP_SECOND_WEAPON");
		
	if(game["am_vote_map"] == 1 || game["am_vote_gametype"] == 1) precacheString(&"AM_MP_TIME_TO_VOTE");

	


	if(game["am_squads"] == 1) precacheString(&"AM_MP_SQUAD_RESPAWN");


	// *  Für Spawn-Protection und Healthbar *
	precacheShader("gfx/hud/hud@health_cross.tga");
	

	// *  Für Spawn-Protection *
	if(game["am_player_spawn_protect"] == 1) precacheHeadIcon("protection_health_cross");


	
		
		
	precacheMenu("open_highscore");
	precacheMenu("close_highscore");
	precacheMenu("step_down");
	precacheMenu("ex_befehl");

	if(game["am_boats"] == 1) {

		game["boat_explosion_fx"] 			= loadfx("fx/explosions/boat_explosion.efx");
		game["boat_splash_fx"]				= loadfx("fx/misc/boat_splash1_higgins.efx");
		game["boat_sidesplash_fx"]			= loadfx("fx/misc/boat_splash_small_higgins.efx");
		game["boat_floorsplash_fx"]			= loadfx("fx/misc/boat_floorsplash_higgens.efx");
		game["boat_wake_fx"]				= loadfx("fx/misc/wake_higgins.efx");
		game["boat_enginespray_fx"]  		= loadfx("fx/misc/boat_enginespray_higgins.efx");
		game["boat_water_explosions_fx"]  	= loadfx("fx/explosions/mortarExp_water.efx");
	}
	
	game["motar_explosions_fx"][0] 	    = loadfx("fx/explosions/mortarExp_dirt.efx");
	game["motar_explosions_fx"][1] 	    = loadfx("fx/explosions/mortarExp_concrete.efx");
	game["motar_explosions_fx"][2] 	    = loadfx("fx/explosions/mortarExp_mud.efx");

	game["artillery_signal_start"]		= loadfx("fx/misc/flare_artillery_marker_start.efx");
	
	game["cold_breath"]					= loadfx("fx/misc/cold_breath.efx");
	game["grenade_explosion"]			= loadfx("fx/explosions/grenadeExp_dirt.efx");
	
	game["bomb_explosion"]			 	= loadfx("fx/explosions/libya_tank_impact.efx");
	game["bomb_explosion_smoke"]	 	= loadfx("fx/explosions/smoke_grenade.efx");
	

	if(game["am_gametype"] == "mm") {
		
		precacheString(&"AM_MP_MMISSION_MISSION_TIME");
		precacheString(&"AM_MP_MMISSION_SUBMISSION_TIME");
	}


	if(game["am_use_colored_smokegrenades"] == 1) {

		precacheItem("red_smoke_grenade_mp");
		precacheItem("blue_smoke_grenade_mp");
		precacheItem("green_smoke_grenade_mp");
	}


//** hinzugefügt für HELLZone_AM **//

	// Killingspree
	precachestring(&"CUSTOM_KILLINGSPREE");
	precachestring(&"CUSTOM_ULTRAKILL");
	precachestring(&"CUSTOM_RAMPAGE");
	precachestring(&"CUSTOM_DOMINATING");
	precachestring(&"CUSTOM_MONSTERKILL");
	precachestring(&"CUSTOM_HOLYSHIT");
	precachestring(&"CUSTOM_SLAUGHTER");
	precachestring(&"CUSTOM_UNSTOPABLE");
	precachestring(&"CUSTOM_GODLIKE");

	// Camperfurz
	game["fartbomb"] 	    = loadfx("fx/fart/fartsmoke.efx");
	
	// Bloodyscreen
	precacheShader("gfx/impact/flesh_hit2");
	precacheShader("gfx/impact/flesh_hitgib");
	
	// Bulletholes
	precacheShader("gfx/custom/bullethit_glass.tga");
	precacheShader("gfx/custom/bullethit_glass2.tga");
	
//** ---Ende für HELLZone_AM--- **//


	game["am_precached_done"] = true;

}