Advertisement
KRDucky

CustomGroup

Mar 14th, 2017
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.78 KB | None | 0 0
  1. // ******************************************************************************************
  2. // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
  3. // ******************************************************************************************
  4. //  @file Name: customGroup.sqf
  5. //  @file Author: AgentRev
  6.  
  7. if (!isServer) exitWith {};
  8.  
  9. private ["_group", "_pos", "_nbUnits", "_unitTypes", "_uPos", "_unit"];
  10.  
  11. _group = _this select 0;
  12. _pos = _this select 1;
  13. _nbUnits = param [2, 7, [0]];
  14. _radius = param [3, 10, [0]];
  15.  
  16. _unitTypes =
  17. [
  18.     "C_man_polo_1_F", "C_man_polo_1_F_euro", "C_man_polo_1_F_afro", "C_man_polo_1_F_asia",
  19.     "C_man_polo_2_F", "C_man_polo_2_F_euro", "C_man_polo_2_F_afro", "C_man_polo_2_F_asia",
  20.     "C_man_polo_3_F", "C_man_polo_3_F_euro", "C_man_polo_3_F_afro", "C_man_polo_3_F_asia",
  21.     "C_man_polo_4_F", "C_man_polo_4_F_euro", "C_man_polo_4_F_afro", "C_man_polo_4_F_asia",
  22.     "C_man_polo_5_F", "C_man_polo_5_F_euro", "C_man_polo_5_F_afro", "C_man_polo_5_F_asia",
  23.     "C_man_polo_6_F", "C_man_polo_6_F_euro", "C_man_polo_6_F_afro", "C_man_polo_6_F_asia"
  24. ];
  25.  
  26. for "_i" from 1 to _nbUnits do
  27. {
  28.     _uPos = _pos vectorAdd ([[random _radius, 0, 0], random 360] call BIS_fnc_rotateVector2D);
  29.     _unit = _group createUnit [_unitTypes call BIS_fnc_selectRandom, _uPos, [], 0, "Form"];
  30.     _unit setPosATL _uPos;
  31.  
  32.     removeAllWeapons _unit;
  33.     removeAllAssignedItems _unit;
  34.     removeUniform _unit;
  35.     removeVest _unit;
  36.     removeBackpack _unit;
  37.     removeHeadgear _unit;
  38.     removeGoggles _unit;
  39.  
  40.     _unit call randomSoldierLoadOut;
  41.     };
  42.  
  43.     _unit enablegunlights "forceOn";
  44.  
  45.     _unit addRating 1e11;
  46.     _unit spawn addMilCap;
  47.     _unit spawn refillPrimaryAmmo;
  48.     _unit call setMissionSkill;
  49.     _unit addEventHandler ["Killed", server_playerDied];
  50. };
  51.  
  52. [_group, _pos] call defendArea;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement