Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // nul = [infspawn, 500, 10] execVM "infspawn.sqf";
- systemchat format ["%1, %2, %3",_this select 0, _this select 1, _this select 2];
- if (!isServer) exitWith{};
- if (_start getVariable ["s",fales]) exitWith{}; // exit if already spawned
- _start = _this select 0;
- _range = _this select 1;
- _amount = _this select 2;
- // _class = ["O_APC_Tracked_02_cannon_F", "O_APC_Wheeled_02_rcws_F"] call bis_fnc_selectRandom;
- _spawn = [getpos _start, east, (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons")] call BIS_fnc_spawnGroup;
- _start setVariable["s",true]; // spawned
- _grp = _spawn;
- _leader = leader _grp;
- _i = 1;
- while { _i < _amount} do {
- _distance = random _range;
- _wdir = random 360;
- _wx = (getPos _start select 0) + (_distance * (sin _wdir));
- _wy = (getPos _start select 1) + (_distance * (cos _wdir));
- _wp = _grp addWaypoint [ [_wx,_wy] , 10, _i ];
- if ( _i == 1 ) then {
- [_grp, _i] setWaypointBehaviour "AWARE";
- [_grp, _i] setWaypointCombatMode "RED";
- [_grp, _i] setWaypointFormation "COLUMN";
- };
- _i = _i + 1;
- };
- _wp = _grp addWaypoint [_start,10,_amount];
- [_grp, _amount] setWaypointType "CYCLE";
- _units = [];
- if (isMultiplayer) then
- {
- _units = playableUnits;
- } else
- {
- _units = switchableUnits;
- };
- waitUntil {{_x distance _leader > 1000} count playableUnits == count playableUnits };
- _start setVariable["s",false]; // despawned
- {deleteVehicle _x} forEach units _grp;
- deleteGroup _grp;
Advertisement
Add Comment
Please, Sign In to add comment