Raised This Month: $ Target: $400
 0% 

catch knife attack


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-10-2009 , 21:51   Re: catch knife attack
Reply With Quote #4

Quote:
Originally Posted by One View Post
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)

RegisterHamHam_TakeDamage "player" "fw_HamTakeDamage" )

public 
fw_HamTakeDamageVictim Inflictor Attacker Float:fDamage BitDamage 
{
    if ( 
IsPlayerAttacker ) && ( get_user_weaponAttacker ) == CSW_KNIFE ) ) 
    {
        
//Victim hurt with knife
    
}

__________________
Bugsy is offline
 



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 22:43.


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