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

[L4D & L4D2] Damage Explodes Grenades (1.11) [10-Jan-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7809
Plugin Version:
1.11
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
2 
Plugin Description:
Detonates grenades on the ground when damaged: shot, or something nearby explodes or ignites them.
Old 09-28-2021 , 21:37   [L4D & L4D2] Damage Explodes Grenades (1.11) [10-Jan-2024]
Reply With Quote #1

About:
  • Thanks to "backwards" for the idea.
  • Allows grenades to explode when damaged or ignite into flames when caught on fire and then detonate.



CVars:

Saved to l4d_explode_grenades.cfg in your servers \left4dead\cfg\sourcemod\ folder.

PHP Code:
// 0=Plugin off, 1=Plugin on.
l4d_explode_grenades_allow "1"

// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d_explode_grenades_modes ""

// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d_explode_grenades_modes_off ""

// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d_explode_grenades_modes_tog "0"

// 0=Off. 1=Boomer explosions can also explode grenades.
l4d_explode_grenades_boomer "0"

// 0.0=Instant. Delay exploding when damaged.
l4d_explode_grenades_delay_molo "1.5"

// 0.0=Instant. Delay exploding when damaged.
l4d_explode_grenades_delay_pipe "1.5"

// 0.0=Instant. Delay exploding when damaged.
l4d_explode_grenades_delay_vomi "0.0"

// "0=No explosion when picking up a damaged grenade. 1=Explode after the _delay cvars when picking up a damaged grenade.
l4d_explode_grenades_detonate "1"

// 0=Off. 1=On. Should _spawn grenades (those which can have multiple grenades in 1 spawn) be allowed to ignite or explode.
l4d_explode_grenades_spawners "1"

// After how many seconds does an ignited grenade detonate.
l4d_explode_grenades_time "5.0"

// Which types of grenades can ignite and then detonate. 1=Molotovs, 2=PipeBombs, 4=Vomit Jars. 7=All. Add numbers together.
l4d_explode_grenades_type "7"

// Which types of grenades can take damage and detonate. 1=Molotovs, 2=PipeBombs, 4=Vomit Jars. 7=All. Add numbers together.
l4d_explode_grenades_types "7"

// L4D2 only. Which types of upgrade ammo can detonate grenades. 0=None. 1=Incendiary ammo. 2=Explosive ammo. 3=Both.
l4d_explode_grenades_upgrade "3"

// Damage Explodes Grenades plugin version.
l4d_explode_grenades_version 


Changes:
Code:
1.11 (10-Jan-2024)
    - Changed the plugins on/off/mode cvars to use the "Left 4 DHooks" method instead of creating an entity.

1.10 (04-May-2022)
    - Added cvars "l4d_explode_grenades_delay_molo", "l4d_explode_grenades_delay_pipe" and "l4d_explode_grenades_delay_vomi" to delay explosion. Requested by "Voevoda".
    - Added cvar "l4d_explode_grenades_detonate" to determine if grenades can explode after being picked up.

1.9 (01-May-2022)
    - L4D2: Added cvar "l4d_explode_grenades_upgrade" to control if upgrade ammo can detonate grenades. Requested by "Voevoda".

1.8 (23-Apr-2022)
    - Compatibility update for "PipeBomb Damage Modifier" plugin. Thanks to "Shao" for reporting.

1.7 (27-Jan-2022)
    - Fixed copy paste mistake from last update sometimes throwing errors.

1.6 (26-Jan-2022)
    - Fixed spawners detonating when no grenades are visible. Thanks to "Shao" for reporting.

1.5 (23-Oct-2021)
    - Fixed error from invalid clients.

1.4 (07-Oct-2021)
    - Fixed not ignoring Boomer explosions. Thanks to "swiftswing1" for reporting.

1.3 (07-Oct-2021)
    - Changed the Boomer detection method to allow Pipe Bombs to explode nearby grenades.
    - Fixed some errors when attacker was invalid. Thanks to "swiftswing1" for reporting.

1.2 (07-Oct-2021)
    - Fixed invalid entity errors. Thanks to "swiftswing1" for reporting.

1.1 (06-Oct-2021)
    - Added cvar "l4d_explode_grenades_boomer" to control if Boomer explosions can explode grenades. Requested by "Shao".
    - Consolidated some code.

1.0 (29-Sep-2021)
    - Initial release.
    - Requires Left4DHooks 1.58 or newer.


Requirements:
  1. Left 4 DHooks Direct 1.58 or newer.



Installation:
DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires Left4DHooks!
  1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.
Attached Files
File Type: smx l4d_explode_grenades.smx (14.1 KB, 47 views)
File Type: sp Get Plugin or Get Source (l4d_explode_grenades.sp - 38 views - 24.3 KB)
__________________

Last edited by Silvers; 01-10-2024 at 12:04.
Silvers is offline
Shao
Senior Member
Join Date: Jan 2015
Old 10-05-2021 , 18:24   Re: [L4D & L4D2] Damage Explodes Grenades (1.0) [29-Sep-2021]
Reply With Quote #2

This is really neat! I'd be nice to have a feature which alerts in chat who may have shot the grenades and what not. Like one of Marttt plugins.

Also Boomer death seems to influence the grenades, perhaps having a toggle for this would be nice since it can lead to very chaotic situations.

Last edited by Shao; 10-05-2021 at 23:14.
Shao is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-06-2021 , 05:43   Re: [L4D & L4D2] Damage Explodes Grenades (1.1) [29-Sep-2021]
Reply With Quote #3

Code:
1.1 (06-Oct-2021)
    - Added cvar "l4d_explode_grenades_boomer" to control if Boomer explosions can explode grenades. Requested by "Shao".
    - Consolidated some code.
Done.

Hints maybe one day.
__________________
Silvers is offline
swiftswing1
Member
Join Date: Oct 2020
Old 10-06-2021 , 06:56   Re: [L4D & L4D2] Damage Explodes Grenades (1.1) [29-Sep-2021]
Reply With Quote #4

hey Silvers,

i'm getting this error:

Quote:
L 10/06/2021 - 21:55:14: [SM] Exception reported: Entity 4 (4) is invalid
L 10/06/2021 - 21:55:14: [SM] Blaming: l4d_explode_grenades.smx
L 10/06/2021 - 21:55:14: [SM] Call stack trace:
L 10/06/2021 - 21:55:14: [SM] [0] GetEntPropVector
L 10/06/2021 - 21:55:14: [SM] [1] Line 453, C:\Servers\L4D2\left4dead2\addons\sourcemod\s cripting\l4d_explode_grenades.sp::TimerDetona te
swiftswing1 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-06-2021 , 07:10   Re: [L4D & L4D2] Damage Explodes Grenades (1.1) [29-Sep-2021]
Reply With Quote #5

Should be fixed in latest.
__________________
Silvers is offline
swiftswing1
Member
Join Date: Oct 2020
Old 10-06-2021 , 22:50   Re: [L4D & L4D2] Damage Explodes Grenades (1.1) [29-Sep-2021]
Reply With Quote #6

sorry i'm still getting the error.
i had a look at my logs and it seems the 'Exception reported: Entity 4 (4) is invalid' was a one off - the error i get slammed with is 'Exception reported: Entity 2 (2) is invalid' (i don't know if that makes a difference).

regardless, the error seems to happen when i shoot to explode a molotov near a pipebomb and/or bile jar, but neither pipebomb or bile jar explodes from molotov fire. i have a backup of v1.0 and this error doesn't occur.

default cvars, sm10, windows
Quote:
01 "Admin File Reader" (1.10.0.6502) by AlliedModders LLC
02 "Admin Help" (1.10.0.6502) by AlliedModders LLC
03 "Admin Menu" (1.10.0.6502) by AlliedModders LLC
04 "Anti-Flood" (1.10.0.6502) by AlliedModders LLC
05 "Basic Ban Commands" (1.10.0.6502) by AlliedModders LLC
06 "Basic Chat" (1.10.0.6502) by AlliedModders LLC
07 "Basic Comm Control" (1.10.0.6502) by AlliedModders LLC
08 "Basic Commands" (1.10.0.6502) by AlliedModders LLC
09 "Basic Info Triggers" (1.10.0.6502) by AlliedModders LLC
10 "Basic Votes" (1.10.0.6502) by AlliedModders LLC
11 "Client Preferences" (1.10.0.6502) by AlliedModders LLC
12 "Fun Commands" (1.10.0.6502) by AlliedModders LLC
13 "Fun Votes" (1.10.0.6502) by AlliedModders LLC
14 "[L4D & L4D2] Damage Explodes Grenades" (1.1) by SilverShot (idea by backwards)
15 "[L4D & L4D2] Left 4 DHooks Direct" (1.60) by SilverShot
16 "Sound Commands" (1.10.0.6502) by AlliedModders LLC
17 "[L4D2] Weapon Drop" (1.6) by Machine, dcx2, Electr000999 /z, Senip, Shao
swiftswing1 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-07-2021 , 05:22   Re: [L4D & L4D2] Damage Explodes Grenades (1.2) [07-Oct-2021]
Reply With Quote #7

ooops thanks I messed up the lines. Should be working again.

Code:
1.2 (07-Oct-2021)
    - Fixed invalid entity errors. Thanks to "swiftswing1" for reporting.
__________________
Silvers is offline
swiftswing1
Member
Join Date: Oct 2020
Old 10-07-2021 , 08:03   Re: [L4D & L4D2] Damage Explodes Grenades (1.2) [07-Oct-2021]
Reply With Quote #8

thanks, molotov works now. however, pipebomb still won't detonate nearby grenades (both molotov and bilejar) - it just flings them away. no errors in console this time.
swiftswing1 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-07-2021 , 08:36   Re: [L4D & L4D2] Damage Explodes Grenades (1.2) [07-Oct-2021]
Reply With Quote #9

Thanks, this is related to Boomer explosion. Will add proper boomer check and remove current hackish type.

Code:
1.3 (07-Oct-2021)
    - Changed the Boomer detection method to allow Pipe Bombs to explode nearby grenades.
    - Fixed some errors when attacker was invalid. Thanks to "swiftswing1" for reporting.
__________________

Last edited by Silvers; 10-07-2021 at 08:40.
Silvers is offline
swiftswing1
Member
Join Date: Oct 2020
Old 10-07-2021 , 09:17   Re: [L4D & L4D2] Damage Explodes Grenades (1.3) [07-Oct-2021]
Reply With Quote #10

appreciate the quick turnaround time!

molotov and pipebomb detonation works good now. unfortunately, new version seems to have messed up the "l4d_explode_grenades_boomer" cvar - grenades detonate on boomer explosion regardless of it being turned on or off.
swiftswing1 is offline
Reply


Thread Tools
Display Modes

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 13:20.


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