Raised This Month: $ Target: $400
 0% 

Hook hit with a knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 11-28-2010 , 11:52   Re: Hook hit with a knife
Reply With Quote #1

#define DMG_SLASH (1<<2) // Cut, clawed, stabbed

I want to add one point player who hit ent created by me ( punkty[idattacker]++;) and remove this ent if he shot ent I do nothing

when I changed condition to
Code:
if(get_user_weapon(idattacker, _, _)==CSW_KNIFE && is_user_alive(idattacker)){
		punkty[idattacker]++;
		remove_entity(this);
		return HAM_SUPERCEDE;
	}
when I hit ent with knife server off
DarkGL is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-28-2010 , 11:58   Re: Hook hit with a knife
Reply With Quote #2

Knife generates dmgbit == (DMG_BULLET|DMG_NEVERGIB)

You can see there how to detect knife damage on a player : http://forums.alliedmods.net/showpos...9&postcount=52

So, make sure attacker is a player, attacker and inflictor are equal, attacker weapon is knife
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 11:28.


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