Raised This Month: $334 Target: $400
 83%   Almost there!

[L4D & L4D2] Anti Rush (1.18) [01-Jun-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
7000
Plugin Version:
1.18
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
15 
Plugin Description:
Slowdown or teleport rushers and slackers back to the group. Uses flow distance for accuracy.
Old 03-26-2020 , 01:00   [L4D & L4D2] Anti Rush (1.18) [01-Jun-2022]
Reply With Quote #1

Features:
  • A proper Anti Rush plugin.
  • Uses the Survivors map flow distance to accurately determine who's ahead/behind.
  • Can slowdown a rushers running speed or teleport them back.
  • Can teleport forward slackers who are lagging behind.
  • Various options to customise.
  • Supports translations.


About:
Loops through Survivors checking their flow distance to the nearest half of Survivors (leading half for rushers, slowest half for slackers). Someone is detected as rushing or falling behind when their flow distance to that half of survivors exceeds the relative l4d_anti_rush_range_* cvar value.

It only checks the nearest half and not everyone because the flow distance data set can be skewed (some people lagging behind, some people ahead). Therefore only when they exceed distance limits to their relative half are they considered out of bounds.

If slowdown is enabled and affecting someone, it will be disabled when their flow distance decreases as they start moving back toward the group, or when they no longer exceed the range cvar distance, or when survivors die and the number alive falls below the minimum threshold of survivors required (minimum 3, set by l4d_anti_rush_players cvar). This means if only 2 survivors are alive, neither will be affected - slowed down or teleported forward because there is no average group to work from.

Does not teleport players who are incapped or pinned by the Smoker, Hunter, Jockey or Charger.

Optionally added left4dhooks forwards "L4D_OnGetCrouchTopSpeed" and "L4D_OnGetWalkTopSpeed" to modify speed when walking or crouched. Uncomment the section and recompile if you want to enable. Only required to slowdown players more than default.


Gauntlet Crescendo Events:
Since version 1.9 an optional config can be setup to detect events where survivors must rush from somewhere to switch off an alarm etc. The config will allow extending the rushing detection range during these events and reset after.

Using Stripper:Source and the command sm_stripper_dump to dump the maps properties, you can find the entity classname and targetname or hammer ID and their entity output to hook and detect for various buttons or triggers etc that turn on and off the crescendo events.

Here is an example config, please post configs for other maps that have gauntlet style events including 3rd party maps.
Spoiler




Thanks:
  • KasperH - For the request.
  • Lux and MasterMind420 for various ideas.
  • xZk, MasterMind420 and Cuba for testing version 1.1.


Cvars:

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

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

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

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

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

// Should the plugin activate in finales. 0=Off. 1=All finales. 2=Gauntlet type finales.
l4d_anti_rush_finale "2"

// Players with these flags will be immune from teleporting forward when behind or slowing down when ahead.
l4d_anti_rush_flags ""

// Should players with the immune flags be counted toward total flow distance. 0=Ignore them. 1=Count them.
l4d_anti_rush_ignore "0"

// 0=Off. How many survivors must be incapped before ignoring them in calculating rushers and slackers.
l4d_anti_rush_incapped "0"

// Minimum number of survivors before the function kicks in. Must be 3 or greater otherwise the lead/last and average cannot be detected.
l4d_anti_rush_players "3"

// How far behind someone can travel from the average distance before being teleported forward.
l4d_anti_rush_range_last "3000.0"

// How far forward someone can travel from the average distance before being teleported or slowed down.
l4d_anti_rush_range_lead "3000.0"

// Maximum speed someone can travel when being slowed down.
l4d_anti_rush_slow "75.0"

// 0=Off. 1=On. Should Anti-Rush be enabled when there are active Tanks.
l4d_anti_rush_tanks "1"

// 0=Off. 1=Print To Chat. 2=Hint Text. Display a message to someone rushing, or falling behind.
l4d_anti_rush_text "1"

// How often to print the message to someone if slowdown is enabled and affecting them.
l4d_anti_rush_time "10"

// What to do with rushers. 1=Slowdown player speed when moving forward. 2=Teleport back to group.
l4d_anti_rush_type "1"

// How far behind someone can travel from the average Survivor distance before being warned about being teleported.
l4d_anti_rush_warn_last "2500.0"

// How far forward someone can travel from the average Survivor distance before being warned about being teleported or slowed down.
l4d_anti_rush_warn_lead "2500.0"

// 0.0=Off. How often to print a message to someone warning them they are ahead or behind and will be teleported or slowed down.
l4d_anti_rush_warn_time "15.0"

// Anti Rush plugin version.
l4d_anti_rush_version 


Changes:
Code:
1.18 (01-Jun-2022)
    - L4D1: Fixed throwing errors.
    - L4D2: Added map "c5m5_bridge" to the data config.

1.17 (04-Dec-2021)
    - Changes to fix warnings when compiling on SourceMod 1.11.

1.16 (19-Oct-2021)
    - Plugin now ignores players who are being healed or revived, or players healing or reviving someone. Requested to "Psyk0tik".

1.15 (09-Sep-2021)
    - Fixed the last update breaking the plugin in L4D1.

1.14 (25-Aug-2021)
    - Plugin now ignores players being carried by the Charger. Thanks to "Darkwob" for reporting.

1.13 (30-Jun-2021)
    - Plugin now ignores players inside elevators.

1.12 (16-Jun-2021)
    - L4D1: Fixed throwing errors about missing property "m_type". Thanks to "Dragokas" for reporting.

1.11 (20-Apr-2021)
    - Added cvars "l4d_anti_rush_flags" and "l4d_anti_rush_ignore" to make players with certain flags immune to the plugins actions. Requested by "Shadowart".

1.10a (12-Apr-2021)
    - Updated data config "data/l4d_anti_rush.cfg" with new triggers. Thanks to "jeremyvillanueva" for providing.

1.10 (23-Mar-2021)
    - Cleaning source code from last update.
    - Fixed potentially using the wrong "add" range from the config.

1.9 (22-Mar-2021)
    - Added optional config "l4d_anti_rush.cfg" to extend the trigger detection range during certain crescendo events. Requested by "SilentBr".

1.8 (09-Oct-2020)
    - Changed cvar "l4d_anti_rush_finale" to allow working in Gauntlet type finales only. Thanks to "Xanaguy" for requesting.
    - Renamed cvar "l4d_anti_rush_inacpped" to "l4d_anti_rush_incapped" fixing spelling mistake.

1.7 (09-Oct-2020)
    - Added cvar "l4d_anti_rush_tanks" to control if the plugins active when any tank is alive.
    - Fixed not resetting slowdown on team change or player death (optimization).

1.6 (15-Jul-2020)
    - Optionally added left4dhooks forwards "L4D_OnGetCrouchTopSpeed" and "L4D_OnGetWalkTopSpeed" to modify speed when walking or crouched.
    - Uncomment the section and recompile if you want to enable. Only required to slowdown players more than default.
    - Thanks to "SilentBr" for reporting.

1.5 (10-May-2020)
    - Added Traditional Chinese and Simplified Chinese translations. Thanks to "fbef0102".
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    - Various changes to tidy up code.

1.4 (10-Apr-2020)
    - Added Hungarian translations. Thanks to "KasperH" for providing.
    - Added Russian translations. Thanks to "Dragokas" for updating with new phrases.
    - Added cvar "l4d_anti_rush_incapped" to ignored incapped players from being used to calculate rushers or slackers distance.
    - Added cvars "l4d_anti_rush_warn_last" and "l4d_anti_rush_warn_lead" to warn players about being teleported or slowed down.
    - Added cvar "l4d_anti_rush_warn_time" to control how often someone is warned.
    - Removed minimum value being set for "l4d_anti_rush_range_lead" cvar which prevented turning off lead feature.
    - The cvars "l4d_anti_rush_range_last" and "l4d_anti_rush_range_lead" minimum values are now set internally (1500.0).
    - Translation files and plugin updated.

1.3 (09-Apr-2020)
    - Added reset slowdown in case players are out-of-bound or have invalid flow distances to calculate the range.
    - Increased minimum value of "l4d_anti_rush_range_lead" cvar from 500.0 to 1000.0.
    - Removed minimum value being set for "l4d_anti_rush_range_last" cvar. Thanks to "Alex101192" for reporting.

1.2 (08-Apr-2020)
    - Added cvar "l4d_anti_rush_finale" to allow or disallow the plugin in finales.

1.1 (07-Apr-2020)
    - Changed how the plugin functions. Now calculates rushers/slackers by their flow distance to the nearest half of Survivors.
    - Fixed not accounting for multiple rushers with "type 2" setting.
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

1.0 (26-Mar-2020)
    - Added Russian translations to the .zip. Thanks to "KRUTIK" for providing.
    - No other changes.

1.0 (26-Mar-2020)
    - Initial Release.


Requirements:

Installation:
  • Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder.

Current Translations: English (en), Hungarian (hu), Russian (ru), Simplified Chinese (zho), Traditional Chinese (chi).


Updating from 1.10a or older:
  • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
Attached Files
File Type: zip l4d_anti_rush.zip (28.5 KB, 112 views)
__________________

Last edited by Silvers; 06-01-2022 at 11:01.
Silvers is offline
KRUTIK
Senior Member
Join Date: Feb 2019
Location: Мос
Old 03-26-2020 , 04:31   Re: [L4D & L4D2] Anti Rush (1.0) [26-Mar-2020]
Reply With Quote #2

Russian translation
Attached Files
File Type: txt anti_rush.phrases.txt (1.0 KB, 186 views)
KRUTIK is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 04-03-2020 , 17:45   Re: [L4D & L4D2] Anti Rush (1.0) [26-Mar-2020]
Reply With Quote #3

If you need help to test please let me know. I have supercoop and superversus servers.
SilentBr is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 04-05-2020 , 03:22   Re: [L4D & L4D2] Anti Rush (1.0) [26-Mar-2020]
Reply With Quote #4

Hope to support single player mode, when survivor_limit 1, prohibit players to sprint
ZBzibing is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-05-2020 , 03:24   Re: [L4D & L4D2] Anti Rush (1.0) [26-Mar-2020]
Reply With Quote #5

Quote:
Originally Posted by ZBzibing View Post
Hope to support single player mode, when survivor_limit 1, prohibit players to sprint
lmao, there are methods for that.

I'm finally going to re-write this today/tomorrow and should be able to publish a fixed version in the next few days.
__________________

Last edited by Silvers; 03-22-2021 at 16:02.
Silvers is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 04-05-2020 , 12:19   Re: [L4D & L4D2] Anti Rush (1.0) [26-Mar-2020]
Reply With Quote #6

Quote:
Originally Posted by Silvers View Post
lmao, there are are methods for that.

I'm finally going to re-write this today/tomorrow and should be able to publish a fixed version in the next few days.
Oh nice.
Alex101192 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-07-2020 , 16:02   Re: [L4D & L4D2] Anti Rush (1.1) [07-Apr-2020]
Reply With Quote #7

I've decided to post the update to get more feedback on any issues. I think it's working fine now, please let me know.
__________________
Silvers is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 04-08-2020 , 17:25   Re: [L4D & L4D2] Anti Rush (1.2) [08-Apr-2020]
Reply With Quote #8

I am currently testing the plugins. Haven't found an issue yet, but I wasn't able to test a lot. I will get back to it.
Alex101192 is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 04-08-2020 , 19:11   Re: [L4D & L4D2] Anti Rush (1.2) [08-Apr-2020]
Reply With Quote #9

So far it's good. However there is some changes that could make it a little bit better.

Maybe it would be better if rushing and behind players were warned before applying the punishment. Simply a message to pop up when survivor reaches certain length. So rushing punishment would be 3000 and warn 2500.

Last edited by Alex101192; 04-09-2020 at 01:06.
Alex101192 is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 04-09-2020 , 17:20   Re: [L4D & L4D2] Anti Rush (1.2) [08-Apr-2020]
Reply With Quote #10

The l4d_anti_rush_range_last does not disable teleport of behind players when set to 0.0 as said in the comments. Instead it just makes the distance at which behind players get teleported very short and very annoying. Only way to get rid of it for me was to set it to a very high number like 999999.
Alex101192 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 16:07.


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