diff --git a/helotraining.Altis/createObj.sqf b/helotraining.Altis/createObj.sqf index 8e857ab..f772b52 100644 --- a/helotraining.Altis/createObj.sqf +++ b/helotraining.Altis/createObj.sqf @@ -9,7 +9,9 @@ _prevLZ = _this select 2; _playerno = _this select 3; _player = playersArray select _playerno; -if (!!(taskIdsArray select _playerno)) exitWith { diag_log format["createObj: Task %1 already exists for %2", (taskIdsArray select _playerno), _playerno] }; +if ((playersArray select _playerno) isEqualTo false) exitWith { diag_log format["createObj: no such player %1", _playerno] }; + +if (!((taskIdsArray select _playerno) isEqualTo false)) exitWith { diag_log format["createObj: Task %1 already exists for %2", (taskIdsArray select _playerno), _playerno] }; _lzLoc = (lzList - [_prevLZ]) call BIS_fnc_SelectRandom; @@ -72,6 +74,7 @@ if (!!(ferryingArray select _playerno)) then _longdesc = _longdesc + "
Be advised: LZ is hot"; }; }; +_longdesc = _longdesc + format["
Land within %1m", lzSize]; _taskid = format["p%1_lz%2", _playerno, _lzLoc]; [[_player, west],[_taskid],[_longdesc, _shortdesc, _shortestDesc],(getPos _lzLoc),"AUTOASSIGNED",1,true, "move", true] call BIS_fnc_taskCreate; diff --git a/helotraining.Altis/init.sqf b/helotraining.Altis/init.sqf index cffc194..0b5ac6c 100644 --- a/helotraining.Altis/init.sqf +++ b/helotraining.Altis/init.sqf @@ -65,7 +65,7 @@ for [{_iX = 0}, {_iX < _maxplayers}, {_iX = _iX + 1}] do ferryingArray set [_iX, false]; landingCompleteArray set [_iX, false]; squadLoadedArray set [_iX, false]; - playersArray set [_iX, ""]; + playersArray set [_iX, false]; taskIdsArray set [_iX, false]; trigIdsArray set [_iX, false]; }; diff --git a/helotraining.Altis/landingComplete.sqf b/helotraining.Altis/landingComplete.sqf index 022c24f..5eeca0e 100644 --- a/helotraining.Altis/landingComplete.sqf +++ b/helotraining.Altis/landingComplete.sqf @@ -9,6 +9,7 @@ _playerno = _this select 4; diag_log format["landingComplete called, _this: %1", _this]; + _vehiclePlayer = vehicle (playersArray select _playerno); deletevehicle _trg; diff --git a/helotraining.Altis/playerkilled.sqf b/helotraining.Altis/playerkilled.sqf index b760936..bd89fb2 100644 --- a/helotraining.Altis/playerkilled.sqf +++ b/helotraining.Altis/playerkilled.sqf @@ -3,9 +3,14 @@ _evt = _this select 0; _target = _evt select 0; _playerno = _this select 1; -_taskid = taskIdsArray select _playerno; -null = [_taskid, "FAILED", False] spawn BIS_fnc_taskSetState; -[_taskid] call BIS_fnc_deleteTask; +if (!((taskIdsArray select _playerno) isEqualTo player)) exitWith { diag_log format["playerkilled: %1 != %2", (taskIdsArray select _playerno), player] }; + +if (!((taskIdsArray select _playerno) isEqualTo false)) then +{ + _taskid = taskIdsArray select _playerno; + null = [_taskid, "FAILED", False] spawn BIS_fnc_taskSetState; + [_taskid] call BIS_fnc_deleteTask; +}; taskIdsArray set [_playerno, false]; // for some reason this either like so or with !! causes compile error