now, i created this script so that when a west man gets shot then he screams one of the editor voices - like MEDIC etc.
now this works PERFECT .... but (u knew there was a but) it errors if 2 get killed at once or in quick succession - understandable
so, looking at the script below, is there any way of it like 'forgeting' about the others and only allow one at a time and not error - so, like, if 5 peeps get killed at once, only one shouts and the rest are forgotten and the script wont error?
cheers.
_unitarray= _this select 0
_hurt = []
_say = ["eng22","eng23","eng29","eng30","eng31","eng32","eng33","eng34"]
#start
_tmp=0
#loop1
_unit = _unitarray select _tmp
? vehicle _unit != _unit : goto "cycle"
? "man" CountType [_unit] == 0 : goto "cycle"
? _unit in _hurt : goto "check"
? getdammage _unit > 0: _hurt = _hurt + [_unit]; goto "speak"
#cycle
_tmp = _tmp + 1
?_tmp > count _unitarray: _tmp=0
~0.05
goto "loop1"
#check
? getdammage _unit == 0: _hurt = _hurt - [_unit]
goto "cycle"
#speak
_rand = random 8
_rand = _rand - _rand % 1
_unit say (_say select _rand)
goto "cycle"