I'm using a script to make a ZU-23 battery to fire continuously to the sky. The script code is the following
_battery = _this select 0;
_angle = _this select 1;
_distance = _this select 2;
_yt = _distance * cos(_angle);
_xt = _yt * tan(getDir _battery);
_zt = _distance * sin(_angle);
_target = _battery modelToWorld [_xt, _yt, _zt];
while {(alive _battery) and (count crew _battery > 0)} do
{
_battery addMagazine "1000Rnd_23mm_2A14_AP";
_battery selectWeapon "2A14";
_battery doWatch _target;
_battery fire "2A14";
sleep (random 1.5);
};
what I want to do is to reload the weapon continuously so it never runs out of ammo. The first line of the script "while-loop" doesn't seem to work though, do you have any hints on how I can restore the weapon ammo?