Raised This Month: $ Target: $400
 0% 

Is there any function can hook the knife attack event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mwy5ym
Junior Member
Join Date: Aug 2008
Old 05-28-2009 , 22:48   Is there any function can hook the knife attack event?
Reply With Quote #1

I need this kind of function, which likes the following functions.
forward client_damage(attacker,victim,damage,wpnindex ,hitplace,TA);
forward client_death(killer,victim,wpnindex,hitplace, TK);
forward grenade_throw( index,greindex,wId );
or it can just like the gun shoot event(http://forums.alliedmods.net/showthread.php?t=54887)
but the gun shoot plugin can not get the knife attack.

I need to get the client id when he is attacking by knife, and do not care if this attack will or not take any damages.(if can get the attack type will be better, I mean the type as: the knife attack is a fast slight attack(usually caused by left click) or a slow pained attack(usually caused by right click))

Overlook my poor english, and I'd appreciate any help you could give me.
mwy5ym is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-28-2009 , 22:52   Re: Is there any function can hook the knife attack event?
Reply With Quote #2

PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_Weapon_PrimaryAttack,"weapon_knife","knifeAttack")
    
RegisterHam(Ham_Weapon_SecondaryAttack,"weapon_knife","knifeAttack")
}

public 
knifeAttack(knifeID)
{
    

__________________
joaquimandrade 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 13:59.


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