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

how to speed up knife attack speed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sunen
Member
Join Date: Jul 2020
Old 09-28-2020 , 03: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 07:36.
Sunen is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 09-28-2020 , 05:25   Re: how to speed up knife attack speed?
Reply With Quote #2

what game? l4d2?
__________________
HarryPotter is offline
Sunen
Member
Join Date: Jul 2020
Old 09-28-2020 , 07: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
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 09-28-2020 , 21: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
Member
Join Date: Jul 2020
Old 09-29-2020 , 03: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



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 21:43.


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