Raised This Month: $12 Target: $400
 3% 

Solved [L4D2] Does anyone know how to modify the reload speed of the shotgun ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cloud talk
Junior Member
Join Date: Oct 2021
Old 05-31-2022 , 09:45   [L4D2] Does anyone know how to modify the reload speed of the shotgun ?
Reply With Quote #1

Is anyone willing to help me ?

Last edited by Cloud talk; 05-14-2023 at 09:04.
Cloud talk is offline
Toranks
Senior Member
Join Date: Dec 2021
Location: Spain
Old 05-31-2022 , 12:15   Re: [L4D2] Does anyone know how to modify the reload speed of the shotgun ?
Reply With Quote #2

Read this:
https://forums.alliedmods.net/showthread.php?t=331064

The base plugin you need (Weapon Handling):
https://forums.alliedmods.net/showthread.php?p=2674761

Code:
#include <sourcemod>
#include <WeaponHandling>

public void WH_OnReloadModifier(int client, int weapon, L4D2WeaponType weapontype, float &speedmodifier)
{
    switch (weapontype)
    {
        case L4D2WeaponType_Pumpshotgun, L4D2WeaponType_PumpshotgunChrome: speedmodifier = speedmodifier * 1.25; // 25% faster reload
        case L4D2WeaponType_Autoshotgun, L4D2WeaponType_AutoshotgunSpas: speedmodifier = speedmodifier * 1.25; // 25% faster reload
    }
}
Compile this simple code by yourself if you know how to do it. Use weaponhandling.inc included inside the Weapon Handling plugin. Change 1.25; // 25% faster reload to the value you desired.
Toranks is offline
Cloud talk
Junior Member
Join Date: Oct 2021
Old 06-01-2022 , 09:38   Re: [L4D2] Does anyone know how to modify the reload speed of the shotgun ?
Reply With Quote #3

It works as I want, but there is a request, is there a way to modify only the SPAS one
Cloud talk is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-01-2022 , 11:06   Re: [L4D2] Does anyone know how to modify the reload speed of the shotgun ?
Reply With Quote #4

Look at the "case" statement lines and omit what you don't need
__________________
Silvers 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 17:27.


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