Hook hit with a knife
Hi I wanted to hook when player hit ent with a knife so I spawn ent:
Code:
public spawn(){a hook of takedamage Code:
public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits){ |
Re: Hook hit with a knife
Replace 1<<2 with defined name so we can read your code without having to open hldsk_const.inc to understand it.
Also, explain better what you are trying to do. |
Re: Hook hit with a knife
#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)){ |
Re: Hook hit with a knife
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 |
| All times are GMT -4. The time now is 11:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.