From 68d4c9bbd80ed2e6528244569c79676b87295bd1 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:54:45 +0300 Subject: init --- Client/Action/Action_EjectCargo.sqf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Client/Action/Action_EjectCargo.sqf (limited to 'Client/Action/Action_EjectCargo.sqf') diff --git a/Client/Action/Action_EjectCargo.sqf b/Client/Action/Action_EjectCargo.sqf new file mode 100644 index 0000000..a10bfd1 --- /dev/null +++ b/Client/Action/Action_EjectCargo.sqf @@ -0,0 +1,23 @@ +Private ["_cargo","_vehicle"]; + +_vehicle = _this select 0; + +//--- Get the crew. +_cargo = (crew _vehicle) - [driver _vehicle, gunner _vehicle, commander _vehicle]; + +{ + if (alive _x && _vehicle == vehicle _x) then { + if (local _x) then { + //--- Dealing with a local unit, probably an AI. + unassignVehicle _x; + _x action ["EJECT", _vehicle]; + } else { + //--- Dealing with a player or a non local unit. + if (isPlayer(leader (group _x))) then { + WFBE_PerformAction = [vehicleVarName(leader(group _x)),'CLTFNCPERFORMACTION',[_x, "EJECT", _vehicle]]; + publicVariable 'WFBE_PerformAction'; + }; + }; + }; + sleep 1; +} forEach _cargo; \ No newline at end of file -- cgit v1.3.1