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

Solved [CS:GO] How to change weapon attackspeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 07-16-2017 , 03:56   [CS:GO] How to change weapon attackspeed
Reply With Quote #1

How to change weapon attackspeed for example 2.0 faster

Last edited by Indarello; 07-18-2017 at 12:12.
Indarello is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-16-2017 , 05:10   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #2

Quote:
Originally Posted by Indarello View Post
How to change weapon attackspeed for example 2.0 faster
Use this code on weapon's fire (HookEvent weapon_fire for example):
PHP Code:
float curtime GetEngineTime()
float nexttime GetEntPropFloat(weaponProp_Data"m_flNextAttack")
nexttime = (curtime nexttime)/2.0 curtime
SetEntPropFloat
(weaponProp_Data"m_flNextAttack"nexttime
But you need small ping for correct client-work, or standart attack-speed longer (with new attack-speed), than ping

Attackspeed precached on client, like other weapon-data, you can't change this with... for example.. SetEntPropFloat(weapon, Prop_Data, "m_flAttackDelay", delay)

Last edited by inklesspen; 07-16-2017 at 10:15.
inklesspen is offline
Send a message via Skype™ to inklesspen
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 07-16-2017 , 10:19   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #3

thanks, but it works not so good
(83.816665)(-0.025000)(125.737503)
(83.816719)(125.737503)(62.856327)
Code:
new Float:curtime = GetEngineTime();
new Float:nexttime = GetEntPropFloat(user, Prop_Data, "m_flNextAttack");
PrintToChatAll("(%f)(%f)(%f)",curtime,nexttime, (curtime - nexttime)/2.0 + curtime);
nexttime = (curtime - nexttime)/2.0 + curtime;
SetEntPropFloat(user, Prop_Data, "m_flNextAttack", nexttime);
Indarello is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-16-2017 , 16:46   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #4

Try this:
PHP Code:
float curtime GetEngineTime()
float nexttime GetEntPropFloat(weaponProp_Data"m_flNextAttack")
nexttime = (nexttime curtime)/2.0 curtime
SetEntPropFloat
(weaponProp_Data"m_flNextAttack"nexttime
p.s. Za4em tebe eto?)

Last edited by inklesspen; 07-16-2017 at 16:49.
inklesspen is offline
Send a message via Skype™ to inklesspen
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 07-16-2017 , 22:38   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #5

Quote:
Originally Posted by inklesspen View Post
Try this:
PHP Code:
float curtime GetEngineTime()
float nexttime GetEntPropFloat(weaponProp_Data"m_flNextAttack")
nexttime = (nexttime curtime)/2.0 curtime
SetEntPropFloat
(weaponProp_Data"m_flNextAttack"nexttime
p.s. Za4em tebe eto?)
Nope
(131.247299)(120.961456)(126.104377)
(131.247344)(126.104377)(128.675857)
(131.279006)(1.000000)(66.139503)
(131.357345)(1.000000)(66.178672)
(131.451065)(1.000000)(66.225532)
Indarello is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-17-2017 , 02:47   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #6

Edit the servers weaponscripts/items files.

Dont forget to whitelist the files u edit.
__________________
Neuro Toxin is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-17-2017 , 04:31   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #7

Quote:
Originally Posted by Neuro Toxin View Post
Edit the servers weaponscripts/items files.

Dont forget to whitelist the files u edit.
Yes, it's works fine. But it change globally.
__________________
Mai inglish is veri gud!
inklesspen is offline
Send a message via Skype™ to inklesspen
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-17-2017 , 04:43   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #8

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!! weapon_fire fired pre weapon-Fire Yes, mai inglish

How running code:
PrimaryAttack > Checks > FireEvent > Fire Bullet
We need hook firebullet... SDKHook_FireBulletsPost for example
Or RequestFrame for skip 1 frame

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

public void OnPluginStart()
{
    
HookEvent("weapon_fire"WeaponFire)
}

public 
void WeaponFire(Event eventchar[] namebool dbc)
{
    
RequestFrame(FirePostFrameevent.GetInt("userid"))
}

public 
void FirePostFrame(int userid)
{
    
int client GetClientOfUserId(userid)
    if(!
client)
        return;
    
int weapon GetEntPropEnt(clientProp_Data"m_hActiveWeapon")
    
float curtime GetGameTime()
    
float nexttime GetEntPropFloat(weaponProp_Send"m_flNextPrimaryAttack")
    
// PrintToChatAll("%f %f", curtime, nexttime)
    
nexttime -= curtime
    nexttime 
*= 1.0/4.0 // 4.0 - multiplier
    
nexttime += curtime
    
// PrintToChatAll("%f", nexttime)
    
SetEntPropFloat(weaponProp_Send"m_flNextPrimaryAttack"nexttime)
    
SetEntPropFloat(clientProp_Send"m_flNextAttack"0.0)

__________________
Mai inglish is veri gud!

Last edited by inklesspen; 07-17-2017 at 05:38.
inklesspen is offline
Send a message via Skype™ to inklesspen
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 07-17-2017 , 04:50   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #9

Quote:
Originally Posted by Neuro Toxin View Post
Edit the servers weaponscripts/items files.

Dont forget to whitelist the files u edit.
I need only for certain clients
Indarello is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 07-18-2017 , 04:24   Re: [CS:GO] How to change weapon attackspeed
Reply With Quote #10

Thanks inklesspen

Last edited by Indarello; 07-18-2017 at 04:26.
Indarello 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 06:01.


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