View Single Post
LenHard
Senior Member
Join Date: Jan 2016
Old 07-21-2018 , 09:48   Re: [CSGO]Plugin Knife Speed
Reply With Quote #2

PHP Code:
#define SPEED 1.3

public Action OnPlayerRunCmd(int clientint &buttons)
{
    if (
IsPlayerAlive(client) && (buttons IN_ATTACK || buttons IN_ATTACK2))
    {
        
char[] sWeapon = new char[32];
        
GetClientWeapon(clientsWeapon32);
        
        if (
StrEqual(sWeapon"weapon_knife"))
        {
            
int iWeapon GetEntPropEnt(clientProp_Send"m_hActiveWeapon");
            
SetEntPropFloat(iWeaponProp_Send"m_flNextPrimaryAttack"GetEntPropFloat(iWeaponProp_Send"m_flNextPrimaryAttack") - ((SPEED 1.0) / 2));
            
SetEntPropFloat(iWeaponProp_Send"m_flNextSecondaryAttack"GetEntPropFloat(iWeaponProp_Send"m_flNextSecondaryAttack") - ((SPEED 1.0) / 2));
        }
    }

Untested.
__________________
LenHard is offline