Raised This Month: $77 Target: $400
 19% 

[L4D/L4D2] Pistol Reloading


Post New Thread Reply   
 
Thread Tools Display Modes
Shao
Senior Member
Join Date: Jan 2015
Old 05-08-2020 , 00:54   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #41

Quote:
Originally Posted by MasterMind420 View Post
This plugin is no longer supported...also this...
Added pistol ammo display using instructor hints. (Instructor Hints must be enabled on clients to see it)
Does the version on multiple equipment post support hints too?
Shao is offline
RDiver
Member
Join Date: Mar 2010
Old 05-21-2020 , 05:38   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #42

Quote:
Originally Posted by MasterMind420 View Post
This plugin is no longer supported...also this...
Added pistol ammo display using instructor hints. (Instructor Hints must be enabled on clients to see it)
Such a pity for a plugin that shouldn't be underrated.

Just wanna confirm ........ really only one stack of ammo clip on hand is given for bots upon spawning with pistols?

Most of L4D2 maps don't have ammo piles at the beginning of the first chapter.

Any advice to remedy this?
RDiver is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-21-2020 , 08:57   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #43

Quote:
Originally Posted by RDiver View Post
Such a pity for a plugin that shouldn't be underrated.

Just wanna confirm ........ really only one stack of ammo clip on hand is given for bots upon spawning with pistols?

Most of L4D2 maps don't have ammo piles at the beginning of the first chapter.

Any advice to remedy this?
Bots should have infinite pistol ammo, when they run out they are automatically reloaded. I did this to prevent issues with going incap, but then again i may only be doing that while they are incap. I don't remember exactly how it works.

Last edited by MasterMind420; 05-21-2020 at 08:58.
MasterMind420 is offline
jking
AlliedModders Donor
Join Date: Jan 2012
Old 10-12-2020 , 23:10   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #44

Hi MM, hoping all is well and thanks for your continued work, really appreciated. I've come back to play around some with the new update, but using the beta reloading with a Magnum, I only get 8 rounds and no reserve, with the non-beta ver I get all the ammo, ideas? I'm still fiddling with and tweaking my server so it's all a WIP but more or less going well.

Last edited by jking; 10-12-2020 at 23:10.
jking is offline
h24672002
Junior Member
Join Date: Jul 2020
Old 10-24-2021 , 18:28   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #45

Does anyone have source file?
Beta1.4
h24672002 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 02-06-2022 , 17:55   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #46

you can try use [L4D/L4D2] Reserve (Ammo) Control and [L4D & L4D2] Mission and Weapons to set Pistols ammo type
__________________
NoroHime is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 01-07-2025 , 06:56   Re: [L4D/L4D2] Pistol reloading with proper ammo counter
Reply With Quote #47

Pistol With UI Ammo Counter For The Limited Ammo Reserve Feature

I’ve modified Mastermind’s last plugin release to incorporate a proper ammo counter that dynamically updates every time the RELOAD key is pressed. While working on this script (using SM 1.11), I encountered several challenges, particularly with the convar `l4d_pistol_ammo_lock` when set to 1. This setting caused conflicts with the pistol-lock function when ammo was depleted, leading to in-game framerate stuttering.

To resolve this issue in L4D1, I adjusted the code to fix the stuttering. However, some players may find it slightly awkward to replenish ammo for empty pistols—specifically when switching back to pistols at an ammo pile. To restock ammo, simply press the USE key quickly. Note that this issue only applies to L4D1, not L4D2. For L4D2, the pistol lock with `l4d_pistol_ammo_lock` set to 1 still works but retains the framerate stutter present in Mastermind’s original plugin. Unfortunately, I haven’t been able to fix that for L4D2.

I replaced the old plugin's convar for choosing between chat and hint notifications with a side panel menu. Critical notifications for empty or restocking pistols are now delivered via hint messages only, while chat messages have been completely removed. These changes result in a cleaner and more elegant interface, in my opinion.

Additionally, I’ve introduced a new convar, `l4d_pistol_clip_size`, which defaults to 15 rounds per pistol magazine. If you use a L4D1 upgrade plugin to increase magazine size to 22, you’ll need to adjust the value in the configuration file accordingly. Please note that the magnum uses 8 bullets, which I haven’t accounted for in my script. This minor inconsistency means the ammo counter will display 8 fewer bullets when replenishing ammo after reloading.

Finally, the convar `l4d_pistol_ammo_reserve` calculates ammo reserves per pistol. For example, if the reserve limit is set to 100 per pistol and a player is using dual pistols, the total reserve will double to 200.

Here’s a short video demo how it functions in-game: https://www.youtube.com/watch?v=I-BN...?v=I-BNTM4TpBo

Please note that I created this plugin for use on my L4D1 server, but I’ve decided to share it with the modding community as well. However, I doubt I'll make any further changes to this plugin. If additional modifications are needed, I recommend another coder take on that task. While the plugin is compatible with L4D2 pistols, I haven’t tested it extensively in that game, as I primarily play L4D1.

EDIT 1: Version 3 (replaced version 2) - see post 48 for details
EDIT 2: Version 4 - see post 49 for details

Enjoy!
Attached Files
File Type: zip Pistol Plugin Version 3.zip (16.3 KB, 1 views)
File Type: zip Pistol Plugin Version 4.zip (18.5 KB, 2 views)

Last edited by Sunyata; 02-14-2025 at 09:50. Reason: Updated to zip files
Sunyata is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 01-09-2025 , 12:31   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #48

I’ve updated Post 47 with Plugin Version 3.

While playing L4D1 with my previous Plugin Version 2, I discovered another issue I had overlooked during testing. When both the primary and secondary weapons ran out of ammo, the primary gun couldn’t be replenished at an ammo pile. Even after the game auto-switched back to pistols, the primary weapon would remain empty and unusable, so players couldn’t switch back to it.

To address this, I added a supplementary OnWeaponSwitch function. This function adds one bonus bullet to the magazine/clip of all carried weapons (including any backpack weapon if you’re using a multi-equipment plugin). This new function ensures proper weapon switching and resolves the issue of restocking all empty weapons at ammo piles. Additionally, players no longer need to press the USE key quickly to replenish ammo, as pistols can now be restocked with ease.

Again, unfortunately, this function currently works only in L4D1 and still has issues in L4D2. Since my primary focus is on plugins for L4D1, I don’t plan to spend additional time resolving this issue for L4D2, as mentioned in my previous post.
Sunyata is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 01-14-2025 , 09:55   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #49

Another plugin update to post 47 - Plugin version 4.

After reviewing this thread in more detail, a few modders had highlighted an exploit involving the 'drop item' plugin. Specifically, dropping and picking up a pistol would partially restock its ammo. This issue affect servers utilizing these plugins [link here]. To address this I have implemented a fix that now prevents the pistol from being dropped, effectively eliminating this exploit.

I’ve also introduced another new feature that automatically replenishes the ammo reserve at the start of each new map or on a round restart. However, players can still manually refill their pistol ammo at designated ammo points throughout the map as usual.

As an optional enhancement, I’ve also added an admin command called '!topup' that manually top-ups the ammo reserve for all players.

Last edited by Sunyata; 01-14-2025 at 10:15.
Sunyata is offline
Sunyata
Senior Member
Join Date: Nov 2017
Location: Wherever I am
Old 01-20-2025 , 12:35   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #50

One other feature I forgot to mention:

In plugin versions 3 & 4, I also added a new feature that allows players to manually reload one bullet at a time into the magazine for the primary weapon (up to 8 bullets max) and secondary pistols (up to 15 bullets max). This feature is designed as a last-resort option for players who have completely run out of ammo for all weapons. To use this mechanic, players can repeatedly switch between their primary and secondary weapons (by alternating between pressing the 1 and 2 keys), which gradually adds one bullet at a time to the magazine. It's a deliberately tedious grind-based gameplay mechanic intended for desperate situations where no ammo piles are currently available.

For a visual demonstration of how this gameplay mechanic would work in an RL situation, see this video: https://www.youtube.com/watch?v=N5fkd2zpIqA&t=17s.

That said, it’s best not to rely on this switch-grinding method. Instead, always aim to restock at the ammo piles, where you can refill all your magazines instantly, saving yourself from the hassle of loading one bullet at a time. And of course, it makes our in-game life so much easier!

Last edited by Sunyata; 02-05-2025 at 08:59.
Sunyata 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 12:12.


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