Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BIS_CP_enemyGrp_rifleSquad = configFile >> "CfgGroups" >> "East" >> "LOP_AM_OPF" >> "Infantry" >> "LOP_AM_OPF_Rifle_squad";
- BIS_CP_enemyTroops = [];
- {
- BIS_CP_enemyTroops pushBack getText (_x >> "vehicle");
- } forEach ("TRUE" configClasses BIS_CP_enemyGrp_rifleSquad);
- sleep 2;
- BIS_CP_targetLocationPos = _this select 0;
- BIS_CP_radius_insertion = _this select 1;
- _allBuildings = BIS_CP_targetLocationPos nearObjects ["House", BIS_CP_radius_insertion];
- _allUsableBuildings = _allBuildings select {count (_x buildingPos -1) > 5};
- _allUsableBuildings_cnt = count _allUsableBuildings;
- _unusedBuildings = +_allUsableBuildings;
- for [{_i = 1}, {_i <= ceil (_allUsableBuildings_cnt / 2) && _i <= (190 * 300)}, {_i = _i + 1}] do {
- _building = selectRandom _unusedBuildings;
- _unusedBuildings = _unusedBuildings - [_building];
- if (_building distance BIS_CP_targetLocationPos > 2) then {
- _building setVariable ["BIS_occupied", TRUE];
- _buldingPosArr = _building buildingPos -1;
- _newGrp = createGroup EAST;
- _unitsCnt = ceil random 23;
- _emptyBuildingPosArr = [];
- {_emptyBuildingPosArr pushBack _forEachIndex} forEach _buldingPosArr;
- for [{_j = 1}, {_j <= _unitsCnt}, {_j = _j + 1}] do {
- _buildingPosID = selectRandom _emptyBuildingPosArr;
- //_emptyBuildingPosArr = _emptyBuildingPosArr - [_buildingPosID];
- _buildingPos = _buldingPosArr select _buildingPosID;
- _newUnit = _newGrp createUnit [selectRandom BIS_CP_enemyTroops, _buildingPos, [], 0, "NONE"];
- _newUnit setPosATL _buildingPos;
- _newUnit setUnitPos "AUTO";
- _newUnit disableai "PATH";
- };
- //hint format ["%1 occupied by %2", getText (configFile >> "CfgVehicles" >> typeOf _building >> "displayName"), groupId _newGrp];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement