Quote:
Originally Posted by One
so i have to get the weapon of the attacker when i register an event "ham_takedamage". but as i said, users weapon can be knife but i need only the knife damage. nothing else.
the user can make damage without any weapons. for example by jumping or touching other players. in this case the weapon can be all weapons.
i need to get only the damage which made by knife.
|
When the victim takes damage, check if attackers current weapon is knife? Am I missing something here? Your explanation sounds odd, you are looking to catch knife damage, then you say you cant check the attackers weapon because he can issue damage just by touching the victim. But won't he need to be holding the knife to issue knife damage?
PHP Code:
#define IsPlayer(%1) (1<=%1<=g_MaxClients)
RegisterHam( Ham_TakeDamage , "player" , "fw_HamTakeDamage" )
public fw_HamTakeDamage( Victim , Inflictor , Attacker , Float:fDamage , BitDamage )
{
if ( IsPlayer( Attacker ) && ( get_user_weapon( Attacker ) == CSW_KNIFE ) )
{
//Victim hurt with knife
}
}
__________________