get time between Knife slashes
Im bad in get_time....or get_gametime
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "fw_Knife_PrimaryAttack_Post", 1) new Float:1slash = get_gametime() new Float:2slash = get_gametime() new Float:result = 2slash - 1 slash not sure. help me to get time between 2 knife attacks |
Re: get time between Knife slashes
Use get_systime() at the end of your function and store it in a global variable. At the begining of the function, use get_systime() again and subtract the previous one to get how many seconds it has been since the last time the function has been executed.
|
Re: get time between Knife slashes
ok finally did it
Sec: 1 Sec: 1 Sec: 0 Sec: 0 Sec: 1 Sec: 0 Sec: 0 Sec: 1 the problem it counts in seconds I need in 0.1 SEC because time between slashes is almost 1/3 sec and as u see it returns 0 .... so I cant divide at 0 |
Re: get time between Knife slashes
It's a float so it gives you a 0.000001 precision. How are you printing the values?
|
Re: get time between Knife slashes
get_systime returns integer not float, use get_gametime the same way if you want float
|
Re: get time between Knife slashes
Ok I did it. time is 0.71 between each slash thanks
|
Re: get time between Knife slashes
If you wanted to know the delay between knife attach, you can just look at the source code : https://github.com/Arkshine/CSSDK/bl.../wpn_knife.cpp and checking m_flNextPrimaryAttack/m_flNextSecondaryAttack . So for slash, 0.35.
|
| All times are GMT -4. The time now is 08:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.