Jump to content
Sign in to follow this  
1para{god-father}

Help with detecing a shot

Recommended Posts

I need some help please, I am trying to create an assassination mission, but when the target has been shot I need to be able to detect this so I trigger men in the area ,

however I do not want the target to be killed just injured and go prone.

Any idea how I can do this ?

Share this post


Link to post
Share on other sites

Hi,

I have tried setting this in his init

this addEventHandler ["hit", "hint format['Hit by %1',_this select 1]"]

Which works , but as I do not want him to be killed I have set him with allowDamage false and then it does not work when i put that in as well , nor does HandleDamage.

I presume I pop this in his init ?

Share this post


Link to post
Share on other sites

So you're doing something wrong. Check everything. AllowDamage or HandleDamage must work when used properly

Share this post


Link to post
Share on other sites

this addEventHandler ["HandleDamage",{_attacker=_this select 3;_damage=_this select 2;if (_damage>0.9) then {_damage=0.9};_damage}]

_attacker is the one who damages the unit, so you can make it execute a script or whatever as long as ;_damage is the last thing within the code (otherwise the damage part doesn't work). Giving a maximum damage of 0.9 will prevent the unit from dying.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×