Opps sorry!
My bad
_unit needs to be in array format before you can remove it from the array
ie.
_unitarray = _unitarray - [_unit]I was also thinking that its possible to get around the problem without removing the unit from that array. This means the unit will execute the script each time he is hurt (after being healed). I havent tried this yet, so it may be buggy:
_unitarray= [sold1,sold2,sold3,sold4,sold5]
_hurt = []
_count = count _unitarray
#start
_tmp=0
#loop1
_unit = _unitarray select _tmp
? _unit in _hurt : goto "check"
? getdammage _unit > 0:[_unit] exec "somescript.sqs"; _hurt = _hurt + [_unit]
#cycle
_tmp = _tmp + 1
?_tmp > _count : _tmp=0
~0.05
goto "loop1"
#check
? getdammage _unit == 0: _hurt = _hurt - [_unit]
goto "cycle"
[edit]Just tested it out - everything seems OK
[/edit]