Raised This Month: $51 Target: $400
 12% 

Solved [L4D2] Special Infected drop ammo boxes when killed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maur0
Senior Member
Join Date: Aug 2020
Old 07-25-2022 , 14:57   [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #1

Hello. I would like to know if it is possible to add a plugin that allows you to create ammo boxes when the Special Infected die when you kill them. Like a TF2 style. Since the idea was, because I removed the ammo stacks to make it more challenging, but you run out of ammo very quickly, so I thought it would be nice to make when you kill Specials they drop an ammo box.

Several things come to mind if possible:
  • They have a chance for the Special Infected to drop an ammo box. For example, 5% or 10% probability.
  • Amount of ammunition to give the Survivor, can be full, medium or little.
  • Remove the ammo box, if more time goes by without any Survivors grabbing it.

That is all. Thank you very much :-)

Last edited by Maur0; 07-28-2022 at 00:25.
Maur0 is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 07-25-2022 , 15:19   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #2

I think this is similar
alasfourom is offline
Maur0
Senior Member
Join Date: Aug 2020
Old 07-26-2022 , 15:13   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #3

Quote:
Originally Posted by alasfourom View Post
I think this is similar
I tried it and unfortunately it was not what I needed. The plugin is good, but it only gives weapons and points. Thing that I need something to give as ammunition boxes and fill the weapon.

Still, thanks for the recommendation.
Maur0 is offline
moschinovac
Member
Join Date: Mar 2019
Location: Vietnam
Old 07-26-2022 , 20:33   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #4

Dunno about that version but Im using HarryPotter’s version and with a little bit modify, I can make box only drop Ammo and how many Ammo refill each box
https://github.com/fbef0102/L4D2-Plu...ter/l4d2_gifts
Tks HarryPotter for his work

Last edited by moschinovac; 07-26-2022 at 20:34.
moschinovac is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 07-26-2022 , 21:27   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #5

Quote:
Originally Posted by moschinovac View Post
Dunno about that version but Im using HarryPotter’s version and with a little bit modify, I can make box only drop Ammo and how many Ammo refill each box
https://github.com/fbef0102/L4D2-Plu...ter/l4d2_gifts
Tks HarryPotter for his work
Quote:
Originally Posted by Maur0 View Post
Thing that I need something to give as ammunition boxes and fill the weapon.
Modify code L94~L184 to reach your idea
__________________
HarryPotter is offline
Maur0
Senior Member
Join Date: Aug 2020
Old 07-27-2022 , 17:05   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #6

I tried to modify what they gave me, I copied it and when I entered the server, when I killed a Special Infected, it still gave me other weapons and items, which only asked for ammunition :/
Code:
static char g_sWeaponModels2[MAX_WEAPONS2][] =
{
	"models/w_models/weapons/w_eq_adrenaline.mdl",
};

#define MODEL_GNOME			"models/props_junk/gnome.mdl"

static char weapons_name[MAX_SPECIALITEMS][2][50] = 
{
	{"ammo","彈藥補給"},
};

static char weapons_name2[MAX_SPECIALITEMS2][2][50] = 
{
	{"ammo","補給彈藥"},
};

//WeaponName/AmmoOffset/AmmoGive
static char weapon_ammo[][][] =
{
	{"weapon_smg",		 				"5", 	"200"},
	{"weapon_pumpshotgun",				"7", 	"32"},
	{"weapon_rifle",					"3", 	"125"},
	{"weapon_autoshotgun",				"8", 	"32"},
	{"weapon_hunting_rifle",			"9", 	"50"},
	{"weapon_smg_silenced",				"5", 	"200"},
	{"weapon_smg_mp5", 	 				"5", 	"200"},
	{"weapon_shotgun_chrome",	 		"7", 	"32"},
	{"weapon_rifle_ak47",  				"3",	"125"},
	{"weapon_rifle_desert",				"3", 	"125"},
	{"weapon_sniper_military",			"10", 	"50"},
	{"weapon_grenade_launcher", 	 	"17", 	"7"},
	{"weapon_rifle_sg552",	 			"3", 	"125"},
	{"weapon_rifle_m60",  				"6",	"100"},
	{"weapon_sniper_awp", 	 			"10", 	"5"},
	{"weapon_sniper_scout",	 			"10", 	"15"},
	{"weapon_shotgun_spas",  			"8",	"32"},
};
Also, when I compile it, it keeps giving me 3 errors and won't let me compile it :/

error 047: array sizes do not match, or destination array is too small
Maur0 is offline
moschinovac
Member
Join Date: Mar 2019
Location: Vietnam
Old 07-27-2022 , 20:39   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #7

Quote:
Originally Posted by Maur0 View Post
I tried to modify what they gave me, I copied it and when I entered the server, when I killed a Special Infected, it still gave me other weapons and items, which only asked for ammunition :/
Code:
static char g_sWeaponModels2[MAX_WEAPONS2][] =
{
	"models/w_models/weapons/w_eq_adrenaline.mdl",
};

#define MODEL_GNOME			"models/props_junk/gnome.mdl"

static char weapons_name[MAX_SPECIALITEMS][2][50] = 
{
	{"ammo","彈藥補給"},
};

static char weapons_name2[MAX_SPECIALITEMS2][2][50] = 
{
	{"ammo","補給彈藥"},
};

//WeaponName/AmmoOffset/AmmoGive
static char weapon_ammo[][][] =
{
	{"weapon_smg",		 				"5", 	"200"},
	{"weapon_pumpshotgun",				"7", 	"32"},
	{"weapon_rifle",					"3", 	"125"},
	{"weapon_autoshotgun",				"8", 	"32"},
	{"weapon_hunting_rifle",			"9", 	"50"},
	{"weapon_smg_silenced",				"5", 	"200"},
	{"weapon_smg_mp5", 	 				"5", 	"200"},
	{"weapon_shotgun_chrome",	 		"7", 	"32"},
	{"weapon_rifle_ak47",  				"3",	"125"},
	{"weapon_rifle_desert",				"3", 	"125"},
	{"weapon_sniper_military",			"10", 	"50"},
	{"weapon_grenade_launcher", 	 	"17", 	"7"},
	{"weapon_rifle_sg552",	 			"3", 	"125"},
	{"weapon_rifle_m60",  				"6",	"100"},
	{"weapon_sniper_awp", 	 			"10", 	"5"},
	{"weapon_sniper_scout",	 			"10", 	"15"},
	{"weapon_shotgun_spas",  			"8",	"32"},
};
Also, when I compile it, it keeps giving me 3 errors and won't let me compile it :/

error 047: array sizes do not match, or destination array is too small
Change line 29-30 to 1
moschinovac is offline
Maur0
Senior Member
Join Date: Aug 2020
Old 07-27-2022 , 21:34   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #8

OMG YEAH!!! Works perfect and exactly what I needed! Thank you so much guys!

@alasfourom - Thank you very much for suggesting this plugin.

@moschinovac @HarryPotter - Thank you very much for modifying the plugin.
Maur0 is offline
Maur0
Senior Member
Join Date: Aug 2020
Old 07-27-2022 , 21:34   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #9

Now if I don't know how to put this discussion topic as resolved. Since I forgot how to do it :/
Maur0 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-27-2022 , 22:49   Re: [L4D2] Special Infected drop ammo boxes when killed
Reply With Quote #10

Quote:
Originally Posted by Maur0 View Post
Now if I don't know how to put this discussion topic as resolved. Since I forgot how to do it :/
Edit main post --> Click "Go Advanced" --> Go to "Title" section --> Choose "[Solved]" as the prefix - default is "(no prefix)"
__________________
Psyk0tik is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode