View Single Post
Author Message
Forgetest
Member
Join Date: Aug 2020
Old 09-29-2022 , 04:13   [L4D & 2] Pick Up / No Auto Switch (4.3 - Jan 4th 2023)
Reply With Quote #1

Description:
Developed after SirPlease's initial work. Big thanks to him.

This plugin allows players to customize their auto switch setting that was forced by game,
which means players can decide to not pull out weapons when picking up.

Besides it provides control over behaviors regarding:
  • Receiving light health items (stop the game forcing players to pull out)
  • Picking up incapped teammates (interrupt the pick-up under certain situations)

Known Issues:
Anyway the features are accomplished server-side, so inevitably there is an unsync issue across network between client and server.

This is unlike other games, e.g., CS:GO where the auto switching is built in so the client can predict it to happen depending on client settings regardless of response from server side.
Eventually it boils down to some failing in manual switching at the very timing when the auto switch should happen, and it could be annoying with high latency.

CVars:
PHP Code:
// "Flags for Switching from current item (1:Secondary, 2: Passed Pills, 4: Primary)"
// The default flags applied on clients
// ("Secondary" and "Primary" flag applies only when the client has never used the command to customize)
pickup_switch_flags "7" 

// "Flags for Stopping Pick-up progress on Incapped Survivors (1:Spit Damage, 2:TankPunch, 4:TankRock"
pickup_incap_flags "7" 

Player Commands:
PHP Code:
// Toggle the auto switch setting for primaries
// The setting is saved server-side and restored every time joining the server.
!primary sm_primary

// Toggle the auto switch setting for secondaries
// The setting is saved server-side and restored every time joining the server.
!secondary sm_secondary 

Dependency:

Installation:
  • Get l4d2_pickup.smx into plugins folder.
  • Get l4d2_pickup.txt into gamedata folder.
  • Get l4d2_pickup.phrases.txt into translations folder.
    • As an English translation file, it can be distributed into other language versions.


Extra Compiling Requirement:

Changelog:
Code:
4.3 (Jan 4th, 2023)
Fix: - Fixed an error in `DTR_OnSetViewModel` where weapon owner is invalid. - Fixed an error in `Event_PlayerHurt` where `L4D_StopReviveAction` processes indices of dying players. Feature: - New console command `sm_primary` for users to change the preference on switching to primary when pick-up. Changed: Source & Translations
4.2.1 (Sep 29th, 2022)
- Initial release on forum.

GitHub Repository

DO NOT CLICK "Get Plugin" BELOW
Attached Files
File Type: txt l4d2_pickup.txt (5.7 KB, 243 views)
File Type: txt l4d2_pickup.phrases.txt (598 Bytes, 189 views)
File Type: sp Get Plugin or Get Source (l4d2_pickup.sp - 134 views - 20.7 KB)
File Type: smx l4d2_pickup.smx (17.9 KB, 263 views)

Last edited by Forgetest; 01-24-2023 at 06:05.
Forgetest is offline