diff --git a/helotraining_rewrite.Altis/createPickupLZ.sqf b/helotraining_rewrite.Altis/createPickupLZ.sqf index 751fdfa..c2607c2 100644 --- a/helotraining_rewrite.Altis/createPickupLZ.sqf +++ b/helotraining_rewrite.Altis/createPickupLZ.sqf @@ -48,7 +48,7 @@ private _taskid = format["pickup_%1", lzCounter]; [_assignTo,[_taskid],[_longdesc, _shortdesc, _shortestDesc],_lzLocation,"AUTOASSIGNED",1,true, "meet", true] call BIS_fnc_taskCreate; private _handlePickup=false; -private _trg = createTrigger["EmptyDetector",getPos _lzLoc, true]; +private _trg = createTrigger["EmptyDetector",getPos _lzLocation, true]; _trg setTriggerArea[lzSize,lzSize,0,false]; _trg setTriggerActivation["WEST","PRESENT",false]; _trg setTriggerTimeout [2.5, 2.5, 2.5, true]; diff --git a/helotraining_rewrite.Altis/init.sqf b/helotraining_rewrite.Altis/init.sqf index 91967a1..f97abd6 100644 --- a/helotraining_rewrite.Altis/init.sqf +++ b/helotraining_rewrite.Altis/init.sqf @@ -69,5 +69,5 @@ publicVariable "missionInitComplete"; if (isServer) then { -// execVM "taskSpawner.sqf"; + execVM "taskSpawner.sqf"; }; diff --git a/helotraining_rewrite.Altis/taskSpawner.sqf b/helotraining_rewrite.Altis/taskSpawner.sqf index 612d995..2814d03 100644 --- a/helotraining_rewrite.Altis/taskSpawner.sqf +++ b/helotraining_rewrite.Altis/taskSpawner.sqf @@ -3,24 +3,24 @@ scopeName "main"; while {true} do { scopeName "mainloop"; - private _justPlayers = BIS_fnc_listPlayers - entities "HeadlessClient_F"; - _result = [_side_tasks, {_this call BIS_fnc_taskCompleted}] call CBA_fnc_reject; + private _justPlayers = (call BIS_fnc_listPlayers) - entities "HeadlessClient_F"; + _result = [([west] call getSideTasks), {_this call BIS_fnc_taskCompleted}] call CBA_fnc_reject; diag_log format["taskSpawner: active tasks: %1 players: ", (count _result), (count _justPlayers)]; - while (count _result != count _justPlayers) do + while {count _result != count _justPlayers} do { scopename "spawnloop"; private _newLZLocation = lzList call BIS_fnc_SelectRandom; { scopename "playerloop"; - private _plr = _x + 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"; + [_newLZLocation, [_plr]] spawn createPickupLZ; breakTo "spawnloop"; - } + }; } forEach _justPlayers; [_newLZLocation, false] spawn createPickupLZ; - } + }; sleep 10; };