summaryrefslogtreecommitdiffstats
path: root/Client/Action/Action_EjectCargo.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:24 +0300
commit628d33984d9228f1781d13a65fbb80f35facc899 (patch)
treecd909141f87e14f22c3511549a9bc067d9ff8b50 /Client/Action/Action_EjectCargo.sqf
downloada2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.gz
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.tar.bz2
a2wf_sara-628d33984d9228f1781d13a65fbb80f35facc899.zip
init
Diffstat (limited to 'Client/Action/Action_EjectCargo.sqf')
-rw-r--r--Client/Action/Action_EjectCargo.sqf23
1 files changed, 23 insertions, 0 deletions
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