//Somewhat dodgy script that counts the amount of bullets in a 100m area around -every- unit in the _units array now and then, and divides the amount by the number of units in the _units array; if there're still bullets left, so to speak, a random unit will cry out that they are under fire. If there are very few units in the array, there's a good chance they'll pick up on their own shooting, hence why this is a slightly dodgy script.;

_Array = _this select 0;
_units = _this select 1;

_j= 0;
_i= {alive _x} count _units;
_BulletAmount = 0;

while {{alive _x} count _units > 0 && RUG_DSAI_TerminalDistance != -1} do

	{
	{_BulletAmount = _BulletAmount + count ((position _x) nearObjects ["BulletBase", 100])} forEach _units;
	_BulletAmount = ceil (_BulletAmount / (count _units));
	
	
	if (_BulletAmount >= 1) then 
		{
		private ["_Sounds", "_random1", "_random2", "_unit"];
		_Sounds = (call _Array) select 0;
		_random1 = floor (random ({alive _x} count _units));
		_random2 = floor (random (count _Sounds));
		_unit = _units select _random1;
		if (_unit !=Player && vehicle _unit == _unit) then {_unit say (_Sounds select _random2)};
		//hint format ["There are %1 bullets in the air around %2", _BulletAmount, _unit];
		};
	
	sleep 4;
	_Bullets = [];
	_BulletAmount = 0;
	};