Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. params ["_unit", ["_rounds", [8, 16]], ["_delay", [10, 20]]];
  2.  
  3. while { alive gunner _unit && canFire _unit} do
  4. {
  5. _amount = (_rounds select 0) + floor random ((_rounds select 1) - (_rounds select 0));
  6. _target = (_unit modelToWorld [0 + random 1800, random 500 + 1600, random 2500 + 3500]);
  7. _unit doWatch _target;
  8. sleep random (_delay select 0) + ((_delay select 1) - (_delay select 0));
  9. for "_i" from 1 to _amount do
  10. {
  11. if (! alive gunner _unit) exitWith {};
  12. _handler = _unit addEventHandler ["Fired", { (_this select 0) setVariable ["a3f_shot", true]; }];
  13. _unit doWatch _target;
  14. _unit fire [(weapons vehicle _unit) select 0];
  15. waitUntil { !isNil { _unit getVariable "a3f_shot" } };
  16. _unit removeEventHandler ["Fired", _handler];
  17. _unit setVariable ["a3f_shot", nil];
  18. };
  19. _unit setVehicleAmmo 1;
  20. };
  21.  
  22. //_aa = [this] execVM "aaa.sqf";
  23. //_aa = [this, [3,5]] execVM "aaa.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement