Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Push Away From Danger - Acid and Fire (1.1) [17-Jun-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
8709
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
2 
Plugin Description:
Pushes bots or players away from fires and spitter acid.
Old 06-03-2024 , 10:21   [L4D & L4D2] Push Away From Danger - Acid and Fire (1.1) [17-Jun-2024]
Reply With Quote #1

About:
  • Requested by "ddd123".
  • Makes bots or players stumble away from fires or acid when they get hurt.


CVars:

Saved to l4d_push_danger.cfg in your servers \cfg\sourcemod\ folder.

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

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

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

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

// What damage type can push a player away: 1=Acid, 2=Burn, 3=Both.
l4d_push_danger_damage_types "3"

// Who should be pushed away from acid/fire damage: 1=Bots, 2=Humans, 3=Both.
l4d_push_danger_types "1"

// Push Away From Danger plugin version.
l4d_push_danger_version 


Changes:
Code:
1.1 (17-Jun-2024)
    - Added cvar "l4d_push_danger_damage_types" - What damage type can push a player away: 1=Acid, 2=Burn, 3=Both. Default: 3.
    - Fixed cvar "l4d_push_danger_allow" having no affect.
    - Fixed debug message spam.
    - Thanks to "BloodyBlade" for changes.

1.0 (03-Jun-2024)
    - Initial release.


Requirements:
  1. Requires: Left 4 DHooks Direct plugin


Installation:
DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires Left 4 DHooks Direct!
  1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_push_danger.sp - 5 views - 8.3 KB)
File Type: smx l4d_push_danger.smx (7.3 KB, 2 views)
__________________

Last edited by Silvers; Yesterday at 05:39.
Silvers is offline
BloodyBlade
Senior Member
Join Date: Feb 2018
Old 06-03-2024 , 14:01   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #2

* Fixed that the l4d_push_danger_allow variable did not affect the functionality of the plugin.
* Fixed message spam.
* Added cvar: l4d_push_danger_damage_types - What damage type can push a player away: 1=Acid, 2=Burn, 3=Both. Default: 3.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_push_danger.sp - 10 views - 7.9 KB)

Last edited by BloodyBlade; 06-09-2024 at 10:05.
BloodyBlade is offline
Sev
Veteran Member
Join Date: May 2010
Old 06-04-2024 , 17:41   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #3

Some sort of debug left in the code?

I keep seeing 0 or 1 in the left hand chat over and over. It goes away when I disable the plugin.
Sev is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-04-2024 , 19:35   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #4

Quote:
Originally Posted by Sev View Post
Some sort of debug left in the code?

I keep seeing 0 or 1 in the left hand chat over and over. It goes away when I disable the plugin.
Yes, looks like debug code. In "OnTakeDamage", you can comment out this line:

PrintToChatAll("%d %d",fake,g_iCvarTypes);
__________________

Last edited by Mystik Spiral; 06-04-2024 at 19:36.
Mystik Spiral is offline
BloodyBlade
Senior Member
Join Date: Feb 2018
Old 06-05-2024 , 12:28   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #5

Quote:
Originally Posted by Sev View Post
Some sort of debug left in the code?

I keep seeing 0 or 1 in the left hand chat over and over. It goes away when I disable the plugin.
Fixed.
BloodyBlade is offline
Superloft
New Member
Join Date: Jan 2019
Old 06-08-2024 , 15:09   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #6

Is there a way for the plugin to push with only fire damage? Maybe with a config or changes inside the code?
Superloft is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 06-09-2024 , 08:48   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #7

Quote:
Originally Posted by Superloft View Post
Is there a way for the plugin to push with only fire damage? Maybe with a config or changes inside the code?
For fire only, change this line from...

PHP Code:
if( strcmp(classname"inferno") == || (g_bLeft4Dead2 && strcmp(classname"insect_swarm") == 0) ) 
...to...

PHP Code:
if( strcmp(classname"inferno") == 
...then recompile.
__________________
Mystik Spiral is offline
BloodyBlade
Senior Member
Join Date: Feb 2018
Old 06-09-2024 , 09:54   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #8

Quote:
Originally Posted by Superloft View Post
Is there a way for the plugin to push with only fire damage? Maybe with a config or changes inside the code?
Added cvar for select what damage type can push a player away.

Last edited by BloodyBlade; 06-09-2024 at 10:05.
BloodyBlade is offline
BloodyBlade
Senior Member
Join Date: Feb 2018
Old 06-09-2024 , 13:16   Re: [L4D & L4D2] Push Away From Danger - Acid and Fire (1.0) [03-Jun-2024]
Reply With Quote #9

Quote:
Originally Posted by Mystik Spiral View Post
For fire only, change this line from...

PHP Code:
if( strcmp(classname"inferno") == || (g_bLeft4Dead2 && strcmp(classname"insect_swarm") == 0) ) 
...to...

PHP Code:
if( strcmp(classname"inferno") == 
...then recompile.
There is also this condition, which also needs to be removed in order to achieve the goal, as it is also responsible for acid damage::
(damagetype == 263168 || damagetype == 265216)

Last edited by BloodyBlade; 06-09-2024 at 13:17.
BloodyBlade 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 21:30.


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