Mirror Damage
Hi. I have this mirror damage plugin:
PHP Code:
|
Re: Mirror Damage
Yes, it is :).
PHP Code:
I have written this in hurry and didn't have time to optimize. |
Re: Mirror Damage
Hmm, thanks, but not exactly what I need. I don't want to minimize the damage, I want to block victim's death even in the worst case scenario, let's say he has 1 hp and gets a headshot with awp.
And another question, related somehow to this: it's possible to restore the victim's armor, without using set_task? |
Re: Mirror Damage
set_user_armor
|
Re: Mirror Damage
return HAM_SUPERCEDE will block all damage in Ham_TakeDamage.
When exactly and under what circumstances do you want to restore armor? unnyquee, you need to return HAM_HANDLED for that to work. Also, damage passed to take_damage is total damage without factoring armor. Hooking take_damage post and using pev_dmg_take will return the actual reduction in victim hp. |
Re: Mirror Damage
Quote:
LE: Yeap, it works, that's what I need. Thank you. |
Re: Mirror Damage
I hope this isn't interpreted as a bump, but I already stated in the post above that the problem was solved and just now realized that it's not, so nobody would'd noticed an edit.
So it's not possible to block the damage taken by the victim with HAM_SUPERCEDE and in the same time to get the correct damage (if victim has armor) so I could pass it to the attacker? Cause I tried something like this PHP Code:
And what's the thing with the inflictor param? I've tested it and notice that is 0 when not attacked by a player, 1...2 (i can test it only with two players so I guess it's the attacker's id, and 116 or 128 or other values maybe if the damage was made by a he grenade. If I'm right it's a safe way to detect he damage? |
Re: Mirror Damage
Inflictor is the entity id if damage caused by a nade.
Do you only need to inflict the damage on attacker? Or do you also want to record damage? TakeDamage pre: SetHamParamEntity( 1 , iAttacker ) return HAM_HANDLED |
Re: Mirror Damage
No, just to inflict the damage to the attacker. Can you give me more details about SetHamParamInt( 1 , iAttacker ), aka I have no idea what to do with it :).
|
Re: Mirror Damage
Just put that in your ham takedamage pre (not post) forward.
PHP Code:
|
| All times are GMT -4. The time now is 03:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.