AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About knife rate (https://forums.alliedmods.net/showthread.php?t=127781)

epic . 05-24-2010 20:06

About knife rate
 
What is the exact rate of knife ?
I searched this : http://forums.alliedmods.net/showpos...2&postcount=12
but, when I test it with that code, it make the knife cutting too fast
so, could you tell me the exact rate of knife(include PrimaryAttackRate and SecondaryAttackRate) when the knife is normal(the rate of default).

Thanks

Voi 05-24-2010 20:51

Re: About knife rate
 
do something like this in every attack:
Code:

client_print(id, print_chat, "attack was on = %f", halflife_time())
Do some knife attacks holding attack button. Take the last attack time and subtract from it the time that was on one attack older.


Not sure if its 100% proper, but i was using this. ^^

epic . 05-24-2010 21:27

Re: About knife rate
 
Quote:

Originally Posted by Voi (Post 1190287)
do something like this in every attack:
Code:

client_print(id, print_chat, "attack was on = %f", halflife_time())
Do some knife attacks holding attack button. Take the last attack time and subtract from it the time that was on one attack older.


Not sure if its 100% proper, but i was using this. ^^

I am not very convenient for testing now, could you give me the result ^ ^

Arkshine 05-25-2010 05:19

Re: About knife rate
 
Check the source code of the knife.

epic . 05-25-2010 05:36

Re: About knife rate
 
Quote:

Originally Posted by Arkshine (Post 1190503)

It is very useful !
but, what does the "tr.flFraction" mean ?
and, what is the number of UTIL_WeaponTimeBase ?

Thanks

Arkshine 05-25-2010 05:39

Re: About knife rate
 
The same as TR_flFraction, the distance between 2 points, 0.0 to 1.0. 0.5 would mean the trace have traveled the half. UTIL_WeaponTimeBase is the same as get_gametime(), but since the weapons are client-side, it should be 0.

epic . 05-25-2010 05:41

Re: About knife rate
 
Quote:

Originally Posted by Arkshine (Post 1190514)
The same as TR_flFraction, the distance between 2 points, 0.0 to 1.0. 0.5 would mean the trace have traveled the half. UTIL_WeaponTimeBase is the same as get_gametime(), but since the weapons are client-side, it should be 0.

You are wonderful !! :up:
Thanks

So, if I change the "amx_knife_attack1_rate" and "amx_knife_attack2_rate" to "0.35" & "0.5" it will knife with default speed when no shield?
Code:

g_pCvarPrimaryAttackRate = register_cvar("amx_knife_attack1_rate", "0.15")
g_pCvarSecondaryAttackRate = register_cvar("amx_knife_attack2_rate", "0.30")


Voi 05-25-2010 06:38

Re: About knife rate
 
How to change knife's max distance?

Arkshine 05-25-2010 06:58

Re: About knife rate
 
Either pathing the memory to change directly 32 or 48 ( look the source code ), either hooking traceline and tracehull and recalculate the end vector with the new distance but it won't work with FM_ nor Orpheu, or rewritting the whole code.

The most efficient way is obviously the first one.

@epic . : What do you want to do exactly?

Voi 05-25-2010 07:42

Re: About knife rate
 
Quote:

Originally Posted by Arkshine (Post 1190551)
Either pathing the memory to change directly 32 or 48 ( look the source code ), either hooking traceline and tracehull and recalculate the end vector with the new distance but it won't work with FM_ nor Orpheu, or rewritting the whole code.

Thanks I see it now. Since there aren't so many examples and Im a hard learner(in programming:P) I would need to request the code for it, cause I have no idea how to do this in orpheu - black magic for me. :P


All times are GMT -4. The time now is 03:39.

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