View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-02-2019 , 14:35   [L4D2] Melee Range (2.0) [21-Apr-2024]
Reply With Quote #1

Related Plugins:

About:
  • Adjustable melee range for individual melee types.
  • Now supports setting the correct distance per client and melee type during simultaneous melee swings.


Thanks:
  • xZk - For the idea and request.
  • hoanganh81097 - For testing version 1.2.


Admin Commands: (requires "z" flag)

PHP Code:
sm_melee_range_reload // Reloads the Melee Weapon Range data config.
sm_melee_range_set // Usage: sm_melee_range_set <melee script name - must exist in the config> <range>. Set the melee range (does not update the config). 

Cvars:

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

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

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

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

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

// Melee Range plugin version.
l4d2_melee_range_version 


Changes:
Code:
2.0 (21-Apr-2024)
    - Removed all the melee range cvars, now using a data config instead. Requested by "little_froy".
    - Added command "sm_melee_range_reload" to reload the data config.
    - Added command "sm_melee_range_set" to set a melee weapon range.

1.6 (11-Dec-2022)
    - Changes to fix compile warnings on SourceMod 1.11.

1.5 (24-Sep-2020)
    - Compatibility update for L4D2's "The Last Stand" update.
    - Added support for the 2 new melee weapons.
    - Added 2 new cvars "l4d2_melee_range_weapon_pitchfork" and "l4d2_melee_range_weapon_shovel".

1.4 (10-May-2020)
    - Added better error log message when gamedata file is missing.
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.

1.3 (01-Apr-2020)
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

1.2 (05-Feb-2020)
    - Added cvar "l4d2_melee_range_weapon_unknown" for 3rd party melee weapons.
    - Changed melee detection method and setting of range.
    - Should no longer conflict with simultaneous melee swings and set the correct range per weapon.
    - Optimized cvars for faster CPU processing.
    - Now requires DHooks and gamedata file.
    - Compiled with SourceMod 1.10.

1.1 (03-Oct-2019)
    - Increased string size to fix the plugin not working. Thanks to "xZk" for reporting.

1.0 (02-Oct-2019)
    - Initial release.


Requirements:

Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
  2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.
  3. Download the .cfg data file and put into your servers \addons\sourcemod\data\ folder.


Updating from 1.4 or older:
  • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
  • Now requires DHooks and new GameData file.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_melee_range.sp - 120 views - 13.7 KB)
File Type: txt l4d2_melee_range.txt (1.0 KB, 1361 views)
File Type: cfg l4d2_melee_range.cfg (975 Bytes, 69 views)
__________________

Last edited by Silvers; 04-21-2024 at 10:39.
Silvers is offline