Thanks for your fast replies...
@MasterMind420
Quote:
Originally Posted by MasterMind420
Use a timer....time exactly when u press attack2. So if it happens 0.3 seconds or whatever after u press the button
|
I already tried that but soon encountered a problem:
When trying to figure out the exact interval betweet two secondary knife attacks using this code:
PHP Code:
public OnClientAuthorized(client)
{
SDKHook(client, SDKHook_TraceAttack, OnTraceAttack);
}
public Action:OnTraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
{
decl String:Weapon[32];
GetClientWeapon(attacker, Weapon, sizeof(Weapon));
if(StrEqual(Weapon[7], "knife", false))
{
PrintToChat(attacker, "Attacked with Knife | Time: %f", GetEngineTime());
}
return Plugin_Continue;
}
the output is the following.:
PHP Code:
Attacked with Knife | Time: 549.686523
Attacked with Knife | Time: 550.781555
Attacked with Knife | Time: 551.906555
Attacked with Knife | Time: 553.001525
Attacked with Knife | Time: 554.111572
Attacked with Knife | Time: 555.446594
Attacked with Knife | Time: 556.556518
As you can see the interval is not constant, it varies from '1.09497' to '1.335022'. Using this method is too inaccurate for me.
@Lux
Quote:
Originally Posted by Lux
|
You mean hooking the swing sound of knife attack? That actually would be possible but i never used this method. Where do i get the path of the swing sound?
__________________