Advertisement
Guest User

Untitled

a guest
Dec 14th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 0.83 KB | None | 0 0
  1.  
  2. if(count units group player == 1) exitWith {};
  3. _units = units group player;
  4. _count = (count _units) - 1;                                //All units except the player will build a perimeter
  5. _angle = 360/_count;                                        //incremental angle
  6.  
  7. player groupChat "Quick, set up a perimeter";               //Short group message
  8.  
  9. for "_i" from 1 to _count do                                //starts at 1 in order to ignore the player
  10. {
  11.     _distance = [5,15] call BIS_fnc_randomNum;              //small distance variations for the visual appearance
  12.     _dir = _i * _angle;                                     //direction the unit should watch
  13.     _pos = [player, _distance, _dir] call BIS_fnc_relPos;   //waypoint position
  14.     _posWatch = [player, 50, _dir] call BIS_fnc_relPos;     //workaround, position to make unit watch proper direction
  15.     _units select _i doMove _pos;
  16.     _units select _i doWatch _posWatch;
  17.     _units select _i setUnitPos "MIDDLE";
  18. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement