#library "Blitz"
#include "zcommon.acs"

script "NoFlameThrower" (void)
{
    SetResultValue(GetCVar("ww2_noflamethrower"));
}

script "NoMinigun" (void)
{
    SetResultValue(GetCVar("ww2_nominigun"));
}

script "NoPowerups" (void)
{
    SetResultValue(GetCVar("ww2_NoPowerups"));
}

script "NoNazis" (void)
{
    SetResultValue(GetCVar("ww2_NoNazis"));
}

//	Game types:
//	 0 	Single player
//	 1 	Cooperative
//	 2 	Deathmatch
//	 3 	Title map
//	 4 	(Skull/dronum) Team game

Script "MultiplayerCheck" (void)
{
	if(GameType() == 4)
		SetResultValue(2); // team games have same weapons as DM
	else
		SetResultValue(GameType());
}

Script "PanzerStrip" ENTER
{
    if (CheckInventory("PanzerfaustAmmo") == 0 && CheckInventory("Panzerfaust") == 1)
    {
		TakeInventory("Panzerfaust",1);
    }	
delay(35);	
restart ;
}

Script "DMSpawnStuff" ENTER
{	
   If (GameType() == GAME_NET_DEATHMATCH && CheckInventory("FlashlightCentered") == 1)
   {
      TakeInventory("FlashlightCentered",1);  
   }
   if (GetCvar("ww2_noflamethrower") == 1 && CheckInventory("Flamer") == 1)
   {
      TakeInventory("Flamer",1);
   }	  
   if (GetCvar("ww2_nominigun") == 1 && CheckInventory("VenomGun") == 1)
   {
      TakeInventory("VenomGun",1);
   }	   
   if (GetCvar("ww2_nopistols") == 1)
   {
	  TakeInventory("Walther",1);	  
	  TakeInventory("M1911",1);	 
	  TakeInventory("Webley",1);	 
	  TakeInventory("Hipower",1);	 
	  TakeInventory("Nagant",1);	 
	  TakeInventory("Luger",1);	 
	  TakeInventory("Nambu",1);	 
	  TakeInventory("Beretta",1);	 	  
   }
   if (GetCvar("ww2_nosmgs") == 1)
   {
	  TakeInventory("MP40",1);
	  TakeInventory("Thompson",1);
	  TakeInventory("Thompson1928",1);	  
	  TakeInventory("Sten",1);
	  TakeInventory("Sten_French",1);	  
	  TakeInventory("PPSH",1);
	  TakeInventory("STG44",1);
	  TakeInventory("Type100",1);
	  TakeInventory("Moschetto",1);	 	  
   }   
   if (GetCvar("ww2_noshotguns") == 1)
   {
	  TakeInventory("DoubleBarrel",1);
	  TakeInventory("DoubleBarrel_Russian",1);
	  TakeInventory("DoubleBarrel_French",1);
	  TakeInventory("PumpAction",1);
	  TakeInventory("PumpAction_Canadian",1);		 	  
	  TakeInventory("PumpAction_Italian",1); 
	  TakeInventory("AutoShotgun",1);  
	  TakeInventory("Katana",1);
	  TakeInventory("Thunderbolt",1); 	  
   }	
   if (GetCvar("ww2_norifles") == 1)
   {
	  TakeInventory("Kar98",1);
	  TakeInventory("Kar98_French",1);
	  TakeInventory("Garand",1);
	  TakeInventory("Enfield",1);
	  TakeInventory("Enfield_Canadian",1);	  	  
	  TakeInventory("Mosin",1);
	  TakeInventory("Arisaka",1);
	  TakeInventory("G43",1);
	  TakeInventory("Carcano",1);  
   }	
   if (GetCvar("ww2_instagib") == 1)
   {
	  TakeInventory("Kar98",1);
	  TakeInventory("Kar98_French",1);
	  TakeInventory("Garand",1);  
	  TakeInventory("Enfield",1);
	  TakeInventory("Enfield_Canadian",1);		  
	  TakeInventory("Mosin",1);
	  TakeInventory("Arisaka",1);
	  TakeInventory("G43",1);
	  TakeInventory("Carcano",1);
	  GiveInventory("Kar98_Instagib",1);  
   }   
   if (GetCvar("ww2_instagib") == 2)
   {
	  TakeInventory("Kar98",1);
	  TakeInventory("Kar98_French",1);
	  TakeInventory("Garand",1); 
	  TakeInventory("Enfield",1);
	  TakeInventory("Enfield_Canadian",1);	 	  
	  TakeInventory("Mosin",1);
	  TakeInventory("Arisaka",1);
	  TakeInventory("G43",1);
	  TakeInventory("Carcano",1);
	  GiveInventory("Kar98_Instagib",1);
	  TakeInventory("DoubleBarrel",1);
	  TakeInventory("DoubleBarrel_Russian",1);
	  TakeInventory("DoubleBarrel_French",1);
	  TakeInventory("PumpAction",1);
	  TakeInventory("PumpAction_Canadian",1);		  
	  TakeInventory("PumpAction_Italian",1);	  
	  TakeInventory("AutoShotgun",1);  
	  TakeInventory("Katana",1);
	  TakeInventory("Thunderbolt",1); 		  
	  GiveInventory("Nailgun",1); 
   }     
delay(5);	
restart ;
}

Script "DMSpawnStuff2" ENTER
{	
   If (GetCvar("ww2_riflesonly") == 1)
   {
	  print(s:"Rifles Only Nigga!");
      TakeInventory("VenomGun",1);
	  TakeInventory("Flamer",1);
	  TakeInventory("Walther",1);	  
	  TakeInventory("M1911",1);	 
	  TakeInventory("Webley",1);	 
	  TakeInventory("Hipower",1);	 
	  TakeInventory("Nagant",1);	 
	  TakeInventory("Luger",1);	 
	  TakeInventory("Nambu",1);	 
	  TakeInventory("Beretta",1);	 	  
	  TakeInventory("MP40",1);
	  TakeInventory("Thompson",1);
	  TakeInventory("Thompson1928",1);	  
	  TakeInventory("Sten",1);
	  TakeInventory("Sten_French",1);	  
	  TakeInventory("PPSH",1);
	  TakeInventory("STG44",1);
	  TakeInventory("Type100",1);
	  TakeInventory("Moschetto",1);	 
	  TakeInventory("DoubleBarrel",1);
	  TakeInventory("DoubleBarrel_Russian",1);
	  TakeInventory("DoubleBarrel_French",1);
	  TakeInventory("PumpAction",1);
	  TakeInventory("PumpAction_Canadian",1);	  
	  TakeInventory("PumpAction_Italian",1);
	  TakeInventory("AutoShotgun",1);	  
	  TakeInventory("Katana",1);
	  TakeInventory("Thunderbolt",1);
   }	     
delay(15);	
restart ;
}