Prevent certain guns from dropping?No Thanks
Dropping the m249 is a little op and i would like to turn it off for my server
may its possible that we can blacklist some weapons?
because the m249 is freeloot :D

adding a blacklist to guns. I have a bunch of bots with m249s so even at the lowest drop percentage there's a good chance to get one. adding a blacklist would solve the problem.

or automatically convert them to gun of choice

Was pritty bad on server with heavys dropping M249s every where.

So heres a quick mod I did to block guns and change them.

Search for code line that has.

var itemWeapon = ItemManager.Create(definition, 1, settings.Guns.RandomSkin ? GetRandomSkin(definition) : 0uL);

 

Above it paste

			//Block guns
			string[] blockeditems = new string[]{"m249", "m39","spas12","l96"};
			foreach (string s in blockeditems)
			{
			if (definition.ToString().Contains(s))
			{
			Puts("Block Drop");
			return;
			}
			}
			

			//Change guns
			string[] changeditems = new string[]{"lr", "mp5"};
			foreach (string s in changeditems)
			{
			if (definition.ToString().Contains(s))
			{
			ItemDefinition itemDefinition = ItemManager.FindItemDefinition("pistol.revolver"); //Revolver
        		if (itemDefinition == null)
        		{
			Puts("Failed To Change Item");
           		return;
        		}
			definition = itemDefinition;
			Puts("Change Drop");
			break;
			}
			}

that worked thank you :)

bmgjet

Was pritty bad on server with heavys dropping M249s every where.

So heres a quick mod I did to block guns and change them.

Search for code line that has.

var itemWeapon = ItemManager.Create(definition, 1, settings.Guns.RandomSkin ? GetRandomSkin(definition) : 0uL);

 

Above it paste

			//Block guns
			string[] blockeditems = new string[]{"m249", "m39","spas12","l96"};
			foreach (string s in blockeditems)
			{
			if (definition.ToString().Contains(s))
			{
			Puts("Block Drop");
			return;
			}
			}
			

			//Change guns
			string[] changeditems = new string[]{"lr", "mp5"};
			foreach (string s in changeditems)
			{
			if (definition.ToString().Contains(s))
			{
			ItemDefinition itemDefinition = ItemManager.FindItemDefinition("pistol.revolver"); //Revolver
        		if (itemDefinition == null)
        		{
			Puts("Failed To Change Item");
           		return;
        		}
			definition = itemDefinition;
			Puts("Change Drop");
			break;
			}
			}
I replaced it. The following error message. 
- Error while compiling: NPCDropGun.cs(160,37): error CS0103: The name `itemWeapon' does not exist in the current context

 

Kobani
I replaced it. The following error message. 
- Error while compiling: NPCDropGun.cs(160,37): error CS0103: The name `itemWeapon' does not exist in the current context

try with 1.7.2 

The line does not exist in version 1.7.2

Kobani

The line does not exist in version 1.7.2



botrespawn has this built in.
Locked automatically