Raised This Month: $403 Target: $400
 100% 

[CSGO]Plugin Knife Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lost_lgz
Member
Join Date: Sep 2011
Old 07-11-2018 , 09:41   [CSGO]Plugin Knife Speed
Reply With Quote #1

who has .....or can create . 1 plugin with knife speed?
i want to use for gungame
ty
__________________

Last edited by Lost_lgz; 07-20-2018 at 14:59.
Lost_lgz is offline
Send a message via Yahoo to Lost_lgz Send a message via Skype™ to Lost_lgz
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.
__________________


Currently accepting private requests.
LenHard is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-23-2018 , 09:39   Re: [CSGO]Plugin Knife Speed
Reply With Quote #3

Quote:
Originally Posted by LenHard View Post
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.
Guaranteed to have bugs / not work at all. use weapon_fire post.
__________________


Accepting private work. Contact me if you're interested.
eyal282 is online now
Lost_lgz
Member
Join Date: Sep 2011
Old 07-23-2018 , 15:30   Re: [CSGO]Plugin Knife Speed
Reply With Quote #4

and how to set speed?
__________________
Lost_lgz is offline
Send a message via Yahoo to Lost_lgz Send a message via Skype™ to Lost_lgz
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-23-2018 , 18:40   Re: [CSGO]Plugin Knife Speed
Reply With Quote #5

Quote:
Originally Posted by Lost_lgz View Post
and how to set speed?
flNextPrimary or Secondary attack ( both should be IDENTICAL! ) are equal to the GetGameTime moment at which attacking is possible. setting them to GetGameTime + 5.0 will set the knife speed to attack every 5 seconds ( way slower than now ). Setting to GetGameTime + 0.1 will have a knife that can attack 10 times in a second. Setting to GetGameTime will allegedly infinitely attack with the knife.
__________________


Accepting private work. Contact me if you're interested.
eyal282 is online now
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Old 07-23-2018 , 20:00   Re: [CSGO]Plugin Knife Speed
Reply With Quote #6

Quote:
Originally Posted by eyal282 View Post
Guaranteed to have bugs / not work at all. use weapon_fire post.
weapon_fire doesn't check IN_ATTACK2.
__________________
Taking requests, add me on Steam.

mug1wara.xyz

People make themselves understood in a way, others understand in another.
mug1wara is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-24-2018 , 07:05   Re: [CSGO]Plugin Knife Speed
Reply With Quote #7

Quote:
Originally Posted by mug1wara View Post
weapon_fire doesn't check IN_ATTACK2.
But GetClientButtons does.
__________________


Accepting private work. Contact me if you're interested.
eyal282 is online now
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Old 07-24-2018 , 09:10   Re: [CSGO]Plugin Knife Speed
Reply With Quote #8

Yea, but GetClientButtons in weapon_fire will be triggered when client presses IN_ATTACK.
__________________
Taking requests, add me on Steam.

mug1wara.xyz

People make themselves understood in a way, others understand in another.
mug1wara is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-25-2018 , 05:17   Re: [CSGO]Plugin Knife Speed
Reply With Quote #9

Quote:
Originally Posted by mug1wara View Post
Yea, but GetClientButtons in weapon_fire will be triggered when client presses IN_ATTACK.
And I suppose IN_ATTACK2 as well. GetClientButtons just lets you differentiate.
__________________


Accepting private work. Contact me if you're interested.
eyal282 is online now
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Old 07-25-2018 , 06:21   Re: [CSGO]Plugin Knife Speed
Reply With Quote #10

No, I literally just tested this a couple of weeks ago.

weapon_fire get's triggered on IN_ATTACK, nothing else
__________________
Taking requests, add me on Steam.

mug1wara.xyz

People make themselves understood in a way, others understand in another.
mug1wara 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 04:17.


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