Raised This Month: $119 Target: $400
 29% 

how to speed up knife attack speed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sunen
Junior Member
Join Date: Jul 2020
Old 09-28-2020 , 04:46   how to speed up knife attack speed?
Reply With Quote #1

[L4D2]
Code:
GetClientWeapon(client, name, sizeof(name));
if (StrEqual(name, "weapon_knife"))//default"weapon_melee"
{
    AdjustWeaponSpeed(client, GetConVarFloat(WeaponSpeedAmount), 1);
}
Why this code is invalid?When i change "weapon_knife" to "weapon_melee",this is valid for all melee weapons。
Does "weapon_knife" exist?

Last edited by Sunen; 09-28-2020 at 08:36.
Sunen is offline
HarryPotter
Senior Member
Join Date: Sep 2017
Location: TW
Old 09-28-2020 , 06:25   Re: how to speed up knife attack speed?
Reply With Quote #2

what game? l4d2?
__________________
HarryPotter is offline
Sunen
Junior Member
Join Date: Jul 2020
Old 09-28-2020 , 08:35   Re: how to speed up knife attack speed?
Reply With Quote #3

Quote:
Originally Posted by fbef0102 View Post
what game? l4d2?
L4D2
Sunen is offline
HarryPotter
Senior Member
Join Date: Sep 2017
Location: TW
Old 09-28-2020 , 22:36   Re: how to speed up knife attack speed?
Reply With Quote #4

PHP Code:
char sModelName[64];
int iSlot1;
iSlot1 GetPlayerWeaponSlot(client1); // get secondary weapon which player holds
if(iSlot1 0//check if player really holds a secondary weapon (ex. pistol, melee)
{
    
GetEntPropString(iSlot1Prop_Data"m_ModelName"sModelNamesizeof(sModelName)); //get weapon model name
    
if(StrContains(sModelName"v_knife_t.mdl"true) != -1//check if is knife model
    
{
        
AdjustWeaponSpeed(clientWeaponSpeedAmount.FloatValue1);
    }

__________________
HarryPotter is offline
Sunen
Junior Member
Join Date: Jul 2020
Old 09-29-2020 , 04:44   Re: how to speed up knife attack speed?
Reply With Quote #5

Quote:
Originally Posted by fbef0102 View Post
PHP Code:
char sModelName[64];
int iSlot1;
iSlot1 GetPlayerWeaponSlot(client1); // get secondary weapon which player holds
if(iSlot1 0//check if player really holds a secondary weapon (ex. pistol, melee)
{
    
GetEntPropString(iSlot1Prop_Data"m_ModelName"sModelNamesizeof(sModelName)); //get weapon model name
    
if(StrContains(sModelName"v_knife_t.mdl"true) != -1//check if is knife model
    
{
        
AdjustWeaponSpeed(clientWeaponSpeedAmount.FloatValue1);
    }

Thanks very much.
Sunen 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 00:26.


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