2016-07-24 21:01:49 +00:00
|
|
|
diag_log "taskSpawner called";
|
2016-07-24 20:17:24 +00:00
|
|
|
scopeName "main";
|
|
|
|
while {true} do
|
|
|
|
{
|
|
|
|
scopeName "mainloop";
|
|
|
|
private _justPlayers = BIS_fnc_listPlayers - entities "HeadlessClient_F";
|
2016-07-24 21:01:49 +00:00
|
|
|
_result = [_side_tasks, {_this call BIS_fnc_taskCompleted}] call CBA_fnc_reject;
|
2016-07-24 20:17:24 +00:00
|
|
|
diag_log format["taskSpawner: active tasks: %1 players: ", (count _result), (count _justPlayers)];
|
|
|
|
while (count _result != count _justPlayers) do
|
|
|
|
{
|
|
|
|
scopename "spawnloop";
|
|
|
|
private _newLZLocation = lzList call BIS_fnc_SelectRandom;
|
|
|
|
{
|
|
|
|
scopename "playerloop";
|
|
|
|
private _plr = _x
|
|
|
|
diag_log format["taskSpawner: checking if %1 is free to take a pickup", _plr];
|
|
|
|
if (count (_plr call BIS_fnc_tasksUnit) == 0) then
|
|
|
|
{
|
|
|
|
[_newLZLocation, [_plr]] execVM "createPickupLZ.sqf";
|
|
|
|
breakTo "spawnloop";
|
|
|
|
}
|
|
|
|
} forEach _justPlayers;
|
2016-07-24 21:01:49 +00:00
|
|
|
[_newLZLocation, false] spawn createPickupLZ;
|
2016-07-24 20:17:24 +00:00
|
|
|
}
|
|
|
|
sleep 10;
|
|
|
|
};
|