aeroson

Untitled

Aug 28th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. // nul = [infspawn, 500, 10] execVM "infspawn.sqf";
  2.  
  3. systemchat format ["%1, %2, %3",_this select 0, _this select 1, _this select 2];
  4.  
  5.  
  6. if (!isServer) exitWith{};
  7. if (_start getVariable ["s",fales]) exitWith{}; // exit if already spawned
  8.  
  9.  
  10. _start = _this select 0;
  11. _range = _this select 1;
  12. _amount = _this select 2;
  13. // _class = ["O_APC_Tracked_02_cannon_F", "O_APC_Wheeled_02_rcws_F"] call bis_fnc_selectRandom;
  14.  
  15. _spawn = [getpos _start, east, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons")] call BIS_fnc_spawnGroup;
  16.  
  17. _start setVariable["s",true]; // spawned
  18.  
  19. _grp = _spawn;
  20.  
  21. _leader = leader _grp;
  22.  
  23. _i = 1;
  24.  
  25. while { _i < _amount} do {
  26.  
  27. _distance = random _range;
  28. _wdir = random 360;
  29. _wx = (getPos _start select 0) + (_distance * (sin _wdir));
  30. _wy = (getPos _start select 1) + (_distance * (cos _wdir));
  31. _wp = _grp addWaypoint [ [_wx,_wy] , 10, _i ];
  32.  
  33. if ( _i == 1 ) then {
  34. [_grp, _i] setWaypointBehaviour "AWARE";
  35. [_grp, _i] setWaypointCombatMode "RED";
  36. [_grp, _i] setWaypointFormation "COLUMN";
  37. };
  38.  
  39. _i = _i + 1;
  40.  
  41. };
  42.  
  43. _wp = _grp addWaypoint [_start,10,_amount];
  44.  
  45. [_grp, _amount] setWaypointType "CYCLE";
  46.  
  47. _units = [];
  48.  
  49. if (isMultiplayer) then
  50. {
  51. _units = playableUnits;
  52. } else
  53. {
  54. _units = switchableUnits;
  55. };
  56.  
  57. waitUntil {{_x distance _leader > 1000} count playableUnits == count playableUnits };
  58.  
  59. _start setVariable["s",false]; // despawned
  60.  
  61. {deleteVehicle _x} forEach units _grp;
  62.  
  63. deleteGroup _grp;
Advertisement
Add Comment
Please, Sign In to add comment