Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- params ["_unit", ["_rounds", [8, 16]], ["_delay", [10, 20]]];
- while { alive gunner _unit && canFire _unit} do
- {
- _amount = (_rounds select 0) + floor random ((_rounds select 1) - (_rounds select 0));
- _target = (_unit modelToWorld [0 + random 1800, random 500 + 1600, random 2500 + 3500]);
- _unit doWatch _target;
- sleep random (_delay select 0) + ((_delay select 1) - (_delay select 0));
- for "_i" from 1 to _amount do
- {
- if (! alive gunner _unit) exitWith {};
- _handler = _unit addEventHandler ["Fired", { (_this select 0) setVariable ["a3f_shot", true]; }];
- _unit doWatch _target;
- _unit fire [(weapons vehicle _unit) select 0];
- waitUntil { !isNil { _unit getVariable "a3f_shot" } };
- _unit removeEventHandler ["Fired", _handler];
- _unit setVariable ["a3f_shot", nil];
- };
- _unit setVehicleAmmo 1;
- };
- //_aa = [this] execVM "aaa.sqf";
- //_aa = [this, [3,5]] execVM "aaa.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement