diff --git a/helotraining.Altis/createObj.sqf b/helotraining.Altis/createObj.sqf index 843041f..7ad4056 100644 --- a/helotraining.Altis/createObj.sqf +++ b/helotraining.Altis/createObj.sqf @@ -29,6 +29,8 @@ _trgcond = "[thisList] call lzlanded"; diag_log format["LZ trigger condition: %1", _trgcond]; diag_log format["LZ trigger action: %1", _trgaction]; _trg setTriggerStatements[_trgcond, _trgaction, ""]; +trigIdsArray set [_playerno, _trg]; + // TODO: delete the trigger when deleting the task on player death or similar diff --git a/helotraining.Altis/description.ext b/helotraining.Altis/description.ext index f98c5ed..e820dcb 100644 --- a/helotraining.Altis/description.ext +++ b/helotraining.Altis/description.ext @@ -8,7 +8,7 @@ RespawnDelay = 8; RespawnDialog = 0; enabledebugconsole = 1; loadScreen = "main.jpg"; -author = Eero af Heurlin; +author = Eero 'rambo' af Heurlin; onLoadName = Helicopter Training MP; diff --git a/helotraining.Altis/init.sqf b/helotraining.Altis/init.sqf index a987230..711e712 100644 --- a/helotraining.Altis/init.sqf +++ b/helotraining.Altis/init.sqf @@ -54,6 +54,7 @@ landingCompleteArray = []; squadLoadedArray = []; playersArray = []; taskIdsArray = []; +trigIdsArray = []; for [{_iX = 0}, {_iX < _maxplayers}, {_iX = _iX + 1}] do @@ -66,6 +67,7 @@ for [{_iX = 0}, {_iX < _maxplayers}, {_iX = _iX + 1}] do squadLoadedArray set [_iX, false]; playersArray set [_iX, ""]; taskIdsArray set [_iX, false]; + trigIdsArray set [_iX, false]; }; publicVariable "squadMDArray"; publicVariable "enemyMDArray"; @@ -75,6 +77,7 @@ publicVariable "landingCompleteArray"; publicVariable "squadLoadedArray"; publicVariable "playersArray"; publicVariable "taskIdsArray"; +publicVariable "trigIdsArray"; missionInitComplete = true; publicVariable "missionInitComplete"; diff --git a/helotraining.Altis/landingComplete.sqf b/helotraining.Altis/landingComplete.sqf index 974b1ee..3bd6c34 100644 --- a/helotraining.Altis/landingComplete.sqf +++ b/helotraining.Altis/landingComplete.sqf @@ -14,6 +14,9 @@ _vehiclePlayer = vehicle (playersArray select _playerno); deletevehicle _trg; null = [_taskid, "SUCCEEDED", False] spawn BIS_fnc_taskSetState; hint 'Landing successful!'; +// the trigger was deleted when handler was called +trigIdsArray set [_playerno, false]; + _squadArray = squadMDArray select _playerno; _enemyArray = enemyMDArray select _playerno; diff --git a/helotraining.Altis/playerkilled.sqf b/helotraining.Altis/playerkilled.sqf index 870f3f5..63c9b01 100644 --- a/helotraining.Altis/playerkilled.sqf +++ b/helotraining.Altis/playerkilled.sqf @@ -7,7 +7,16 @@ _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 +//if ((trigIdsArray select _playerno)) then +//{ + deleteVehicle (trigIdsArray select _playerno); +//} +trigIdsArray set [_playerno, false]; + publicVariable "taskIdsArray"; +publicVariable "trigIdsArray"; _squadArray = squadMDArray select _playerno; _enemyArray = enemyMDArray select _playerno;