Raised This Month: $32 Target: $400
 8% 

[L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)


Post New Thread Reply   
 
Thread Tools Display Modes
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-24-2020 , 19:16   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #41

Updated gamedata to support laststand update.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 09-25-2020 , 10:48   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #42

Quote:
L 09/25/2020 - 21:47:59: [SM] Exception reported: Unable to get offset for 'CTerrorPlayer::GetReloadDurationModifier'
L 09/25/2020 - 21:47:59: [SM] Blaming: Weaponhandling.smx
L 09/25/2020 - 21:47:59: [SM] Call stack trace:
L 09/25/2020 - 21:47:59: [SM] [0] SetFailState
L 09/25/2020 - 21:47:59: [SM] [1] Line 618, D:\Github\Weapon_Handling_API\addons\sourcemo d\scripting\WeaponHandling.sp::LoadHooksAndPa tches
L 09/25/2020 - 21:47:59: [SM] [2] Line 173, D:\Github\Weapon_Handling_API\addons\sourcemo d\scripting\WeaponHandling.sp::OnPluginStart
[SM] Plugin Weaponhandling.smx failed to load: Error detected in plugin startup (see error logs).
strikeraot is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-25-2020 , 11:19   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #43

I missed updating the offset somehow should be good now.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
t0m50n
Junior Member
Join Date: Mar 2020
Location: England
Old 09-26-2020 , 05:47   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #44

Hi Lux, thanks for the great plugins! The attached zip still has the old gamedata file for me (doesn't match the repo version)

Last edited by t0m50n; 09-26-2020 at 05:47.
t0m50n is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-26-2020 , 08:21   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #45

Quote:
Originally Posted by t0m50n View Post
Hi Lux, thanks for the great plugins! The attached zip still has the old gamedata file for me (doesn't match the repo version)
You sure? I downloaded the the zip from here and compared it and they match.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
t0m50n
Junior Member
Join Date: Mar 2020
Location: England
Old 09-26-2020 , 09:31   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #46

Oops false alarm, it was just different line endings in the files.
t0m50n is offline
skidrowa
New Member
Join Date: Feb 2013
Old 09-27-2020 , 22:48   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #47

How would I go about changing the reload speed for specific weapons?
I tried editing the demo script to basically have the speedup effect enabled without having to take an adrenaline shot, but i'm complety lost with sourcepawn :/
skidrowa is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-27-2020 , 23:08   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #48

Quote:
Originally Posted by skidrowa View Post
How would I go about changing the reload speed for specific weapons?
I tried editing the demo script to basically have the speedup effect enabled without having to take an adrenaline shot, but i'm complety lost with sourcepawn :/
You can add the forward you want and use a switch statement here.

PHP Code:
public void WH_OnReloadModifier(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier)
{
    
float fReloadSpeed GetReloadSpeedModifier(weapontype);
    if(
fReloadSpeed == -1.0)
        return;
    
    
speedmodifier speedmodifier fReloadSpeed;// multiply and modifiers already active (multiplicative)
    //speedmodifier = speedmodifier + fReloadSpeed;// additive example
}

float GetReloadSpeedModifier(L4D2WeaponType WeaponType)
{
    
//you can add more cases to change each gun you want.
    
switch(WeaponType
    {
        case 
L4D2WeaponType_AutoshotgunSpasL4D2WeaponType_PumpshotgunL4D2WeaponType_PumpshotgunChrome:
        {
            return 
1.2;//abit faster
        
}
        case 
L4D2WeaponType_Autoshotgun:
        {
            return 
10.0;//ultra fast
        
}
        default:
        {
            return 
2.0;//default will always go here if no case matches so every weapon that is not a type above is 2x reload speed.
        
}
    }
    
//will never reach here if you use default case if thats the case remove default if you don't want to change anything.
    
return -1.0;// none of these guns return -1

Besure to read the include as that has a full list of weapon types in the enum.
Enjoy
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
skidrowa
New Member
Join Date: Feb 2013
Old 09-27-2020 , 23:35   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #49

Ahhhh, I see! That works perfectly! Thank you so much!
skidrowa is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 09-27-2020 , 23:54   Re: [L4D/L4D2]WeaponHandling_API(25/09/2020 - 1.0.4)
Reply With Quote #50

Quote:
Originally Posted by skidrowa View Post
Ahhhh, I see! That works perfectly! Thank you so much!
No problem, overtime when you learn more you can do more possibilities of modifiers due to conditions like being low health slows reloading and shotgun shooting ect.
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux 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 18:49.


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