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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Foxy0606
Junior Member
Join Date: Feb 2022
Old 02-28-2022 , 01:36   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #81

HAHAHAHAHA... Finally done it! XD
Foxy0606 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 02-28-2022 , 03:24   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #82

Quote:
Originally Posted by Foxy0606 View Post
Thanks for ur instruction.
So I have prepared a sourcode like these:

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

forward void WH_OnDeployModifier(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier);
forward void WH_OnGetRateOfFire(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier);
forward void WH_OnReloadModifier(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier);


public 
void WH_OnGetRateOfFire(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier)
{
    switch (
weapontype)
    {
        case 
L4D2WeaponType_HuntingRiflespeedmodifier speedmodifier 2// 100% faster fire rate
        
case L4D2WeaponType_SniperMilitaryL4D2WeaponType_SniperAwpL4D2WeaponType_SniperScoutspeedmodifier speedmodifier 2// 100% faster fire rate
        
case L4D2WeaponType_PumpshotgunL4D2WeaponType_PumpshotgunChromespeedmodifier speedmodifier 2// 100% faster fire rate
        
case L4D2WeaponType_AutoshotgunL4D2WeaponType_AutoshotgunSpasspeedmodifier speedmodifier 2.5// 150% faster fire rate
        
case L4D2WeaponType_RifleL4D2WeaponType_RifleAk47L4D2WeaponType_RifleDesertL4D2WeaponType_RifleM60L4D2WeaponType_RifleSg552speedmodifier speedmodifier 1.25//25% faster fire rate
        
    
}
}

public 
void WH_OnReloadModifier(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier)
{
    switch (
weapontype)
    {
        case 
L4D2WeaponType_PumpshotgunL4D2WeaponType_PumpshotgunChromespeedmodifier speedmodifier 2// 100% faster reload
        
case L4D2WeaponType_AutoshotgunL4D2WeaponType_AutoshotgunSpasspeedmodifier speedmodifier 2.5// 150% faster reload
        
case L4D2WeaponType_HuntingRiflespeedmodifier speedmodifier 2// 100% faster reload
        
case L4D2WeaponType_SniperMilitaryL4D2WeaponType_SniperAwpL4D2WeaponType_SniperScoutspeedmodifier speedmodifier 2// 100% faster reload
        
case L4D2WeaponType_RifleL4D2WeaponType_RifleAk47L4D2WeaponType_RifleDesertL4D2WeaponType_RifleM60L4D2WeaponType_RifleSg552speedmodifier speedmodifier 2//100% faster reload
    
}
}

public 
void WH_OnDeployModifier(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier)
{
    switch (
weapontype)
    {
        case 
L4D2WeaponType_HuntingRiflespeedmodifier speedmodifier 2// 100% faster deploy time
        
case L4D2WeaponType_SniperMilitaryL4D2WeaponType_SniperAwpL4D2WeaponType_SniperScoutspeedmodifier speedmodifier 2// 100% faster deploy time
        
case L4D2WeaponType_PumpshotgunL4D2WeaponType_PumpshotgunChromespeedmodifier speedmodifier 2// 100% faster deploy time
        
case L4D2WeaponType_AutoshotgunL4D2WeaponType_AutoshotgunSpasspeedmodifier speedmodifier 2// 100% faster deploy time
        
case L4D2WeaponType_RifleL4D2WeaponType_RifleAk47L4D2WeaponType_RifleDesertL4D2WeaponType_RifleM60L4D2WeaponType_RifleSg552speedmodifier speedmodifier 2//100% faster deploy time
        
    
}

Then as u say, create a file has .sp extension and convert it to .smx right XD.
yeah thats right, basically no problem, but when you include <weaponhandling> you dont need decalre forward any more
my advice this can be dynamic rather than harcode speed, or you think some idea i can write
__________________
NoroHime is offline
kazya3
Member
Join Date: Aug 2019
Location: CN
Old 04-09-2022 , 23:52   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #83

Is that a bug when i install this api plugin then i switch to the slot2 weapons like melee, the switch animation speed become so fast。 how to set the animation speed become normal?
kazya3 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 04-10-2022 , 02:51   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #84

Quote:
Originally Posted by kazya3 View Post
Is that a bug when i install this api plugin then i switch to the slot2 weapons like melee, the switch animation speed become so fast。 how to set the animation speed become normal?
Set convar wh_deploy_animation_speed -1
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
spaghettipastaman
Member
Join Date: May 2021
Old 04-11-2022 , 16:52   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #85

i finally found how to configure the firerate in this plugin so i'll leave it here for other people


PHP Code:
public void WH_OnGetRateOfFire(int clientint weaponL4D2WeaponType weapontypefloat &speedmodifier)
{
    
float fRateOfFire GetRateOfFire(weapontype);
    if(
fRateOfFire == -1.0)
        return;
    
    
speedmodifier speedmodifier fRateOfFire;// multiply and modifiers already active (multiplicative)
}

float GetRateOfFire(L4D2WeaponType WeaponType)
{
    
//you can add more cases to change each gun you want.
    
switch(WeaponType
    {
        case 
L4D2WeaponType_something:
      {
        return 
1.0;
      }
      default:
      {
        return 
1.0;
      }
    }

spaghettipastaman is offline
Dominatez
Senior Member
Join Date: Oct 2009
Location: Birmingham, UK
Old 11-07-2022 , 16:42   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #86

Was going to say something, but thought better of it.

Last edited by Dominatez; 11-07-2022 at 17:21.
Dominatez is offline
ForTheSakura
Junior Member
Join Date: Dec 2022
Old 12-15-2022 , 12:26   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #87

I can't get it to work properly and would appreciate some help

Spoiler


I tried all values, but the smg's speed never changes and remains the same as in the game, while all other weapons have insane speed that no value can change


What's the problem?
ForTheSakura is offline
ForTheSakura
Junior Member
Join Date: Dec 2022
Old 12-15-2022 , 15:28   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #88

I finally got it after many failed attempts
Spoiler

Now my last and most difficult problem is that L4D2WeaponType Melee doesn't seem to do anything. I think I'm using it wrong. how do I use OnMeleeSwing to make all melee weapons and survivor shoves faster?
ForTheSakura is offline
Kerouha
Member
Join Date: Jul 2015
Location: Russian Federation
Old 02-15-2023 , 08:14   Re: [L4D/L4D2]WeaponHandling_API(22/04/2021 - 1.0.6)
Reply With Quote #89

Quote:
Originally Posted by ForTheSakura View Post
Now my last and most difficult problem is that L4D2WeaponType Melee doesn't seem to do anything. I think I'm using it wrong. how do I use OnMeleeSwing to make all melee weapons and survivor shoves faster?
Doesn't something like this work? Though it won't affect secondary attack (shove), and applies to all melee weapons.

Code:
public void WH_OnMeleeSwing(int client, int weapon, float &speedmodifier)
{
	speedmodifier = 2.0;
}
Kerouha is offline
Kerouha
Member
Join Date: Jul 2015
Location: Russian Federation
Old 02-15-2023 , 08:15   Re: [L4D/L4D2]WeaponHandling_API – Bug?
Reply With Quote #90

Quote:
Originally Posted by Lux View Post
...
Reload animation plays at standard speed after secondary attack (shove). Is there something that can be done about it?
Kerouha is offline
Reply



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 01:46.


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