View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-14-2020 , 10:22   [L4D & L4D2] Unscope Sniper On Shoot (1.10) [11-Dec-2022]
Reply With Quote #1

About:
  • Makes players un-zoom / un-scope Sniper Rifles on each shot.
  • The cvar l4d_unscope_rescope auto rescopes after reloading bolt action sniper rifles.
  • Thanks to "Iizuka07" for the idea and request.


Cvars:

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

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

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

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

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

// 0=Off. 1=Rescope the view after shooting and reloading bolt action rifles (AWP and Scout).
l4d_unscope_rescope "1"

// 1=Hunting Rifle. L4D2 only: 2=Sniper Military, 4=Sniper AWP, 8=Sniper Scout. 15=All. Add numbers together.
l4d_unscope_types "15" // "1" in L4D1.

// Unscope plugin version.
l4d_unscope_version 


Changes:
Code:
1.10 (11-Dec-2022)
    - Changes to fix compile warnings on SourceMod 1.11.

1.9 (11-Oct-2021)
    - Fixed Zoom and Unzoom logic being inverted.

1.8 (02-Jul-2021)
    - Fixed randommly vocalizing. No more hackish workarounds, zooms and unzooms correctly. Thanks to "Iizuka07" for testing.

1.7 (01-Jul-2021)
    - Fixed crashing by deleting entities in "SDKHook_SpawnPost" instead of "OnEntityCreated". Thanks to "Iizuka07" for reporting.

1.6 (29-Jun-2021)
    - Fixed vocalizing when unscoping. Thanks to "Iizuka07" for reporting.

1.5 (26-Jun-2021)
    - Fixed rescope feature adding zoom when changing weapon straight after. Thanks to "Iizuka07" for reporting.

1.4 (24-May-2021)
    - Added cvar "l4d_unscope_rescope" to rescope bolt action snipers after shooting and reloading. Requested by "AI0702".

1.3 (23-May-2021)
    - Fixed not unscoping while the players eyes are moving into scoped view. Thanks to "AI0702" for reporting.
    - Removed gamedata dependency.

1.2a (24-Sep-2020)
    - Compatibility update for L4D2's "The Last Stand" update.
    - GameData .txt file updated.

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

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

1.0 (14-Mar-2020)
    - Initial release.


Updating from 1.3 or older:
  • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.


Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_unscope.sp - 229 views - 12.4 KB)
__________________

Last edited by Silvers; 12-11-2022 at 03:44.
Silvers is offline