From af6adb7c2162974051ff669ed01443edb56dc01e Mon Sep 17 00:00:00 2001 From: SilenceIsFatto <78276788+SilenceIsFatto@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:54:02 +0100 Subject: [PATCH] Lock airbase vehicles, unlock on flag capture --- A3A/addons/core/functions/Base/fn_mrkWIN.sqf | 6 +++++- A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf | 8 +++++--- A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/A3A/addons/core/functions/Base/fn_mrkWIN.sqf b/A3A/addons/core/functions/Base/fn_mrkWIN.sqf index 01a36a3700..ea45103fc3 100644 --- a/A3A/addons/core/functions/Base/fn_mrkWIN.sqf +++ b/A3A/addons/core/functions/Base/fn_mrkWIN.sqf @@ -30,7 +30,11 @@ if (_caller isNotEqualTo player) exitWith { private _markerX = [airportsX + resourcesX + factories + outposts + seaports + milbases, getPosATL _flagX] call BIS_fnc_nearestPosition; -// private _hideEnemyMarkers = missionNamespace getVariable ["A3U_setting_hideEnemyMarkers",false]; +private _vehicles = _flagX getVariable ["A3U_zoneVehicles", []]; + +{ + [_x, false] call A3U_fnc_setLock; +} forEach _vehicles; if (hideEnemyMarkers) then { "Dum"+_markerX setMarkerAlpha 1; diff --git a/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf b/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf index f80f32a80a..1954642490 100644 --- a/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf +++ b/A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf @@ -452,9 +452,11 @@ for "_i" from 0 to (count _array - 1) do { ["locationSpawned", [_markerX, "Airport", true]] call EFUNC(Events,triggerEvent); -// { - -// } forEach _vehiclesX; +{ + [_x, true] call A3U_fnc_setLock; +} forEach _vehiclesX; + +flagX setVariable ["A3U_zoneVehicles", _vehiclesX]; waitUntil {sleep 1; (spawner getVariable _markerX == 2)}; diff --git a/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf b/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf index f28e6f5cb2..6e03621305 100644 --- a/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf +++ b/A3A/addons/ultimate/functions/vehicles/fn_setLock.sqf @@ -22,6 +22,7 @@ params [ ]; if (_vehicle isEqualTo ObjNull || {isNil "_vehicle"}) exitWith {false}; +if (!(alive) _vehicle) exitWith {false}; _vehicle lock _state;