this addeventhandler ["dammaged", {_this select 0 setDamage -5}];
And one unit with this in his init field:
this addeventhandler ["hit", {_this select 0 setdamage -5}];
The latter one will survive your barrage of bullets, whereas the former won't.
I know this thread is older than Yoda, (that's 900 years
+ a long time ago!
)
and I did not see a solution to the headshot bug,
so...
here's my two bits (:flips_a_quarter:)
Anyway when the script init-s, in addition to the hit event handler, you add a dammaged one as well so that,
when hit in the head you could have:
this addeventhandler["Dammaged", {(_this ) exec "headcheck.sqs"]
headcheck.sqs:
? _this select 1=="hlava":(_this select 0) setdammage 1
or alternatively:
? _this select 1=="hlava":_hlava_head_shot=true;
exit
where in the body armour script, if (_hlava_head_shot) then {removebodyarmour;unit setdammage 1}
or something like that.
that way if they don't get headshotted then they still have their armour, but if they do they die despite it.
Luke
P.S. if this problem has been solved, then
a) Hi!
b) Thanx for letting me exercise my fingertips/get my typing practice in.