Advertisement
JademusSreg

UnitCreateInCircle

Feb 28th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. unitgroup UnitCreateInCircle (int quantity, string id, int style, int player, point center, fixed radius, fixed polarAnchor, fixed faceAnchor)
  2. {
  3.     // Local variables
  4.     unitgroup group = UnitGroupEmpty();
  5.     int count = 0;
  6.     fixed angle = (360.0 / MinF(quantity,1));
  7.     fixed adjust;
  8.     // While count is less than quantity, create units
  9.     while (count < quantity)
  10.     {
  11.         adjust = count * angle;
  12.         UnitGroupAddUnitGroup(group,UnitCreate(1,id,c_unitCreateIgnorePlacement,player,PointWithOffsetPolar(center,radius,polarAnchor-adjust),faceAnchor-adjust));
  13.         count+=1;
  14.     }
  15.     return group;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement