ACE3/addons/zeus/functions/fnc_moduleUnloadFromCargo.sqf
johnb432 bae63636b7
Zeus - Add Zeus modules for unloading cargo (#9661)
Added unload cargo zeus module

Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
2023-11-21 20:44:08 -03:00

48 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: johnb43
* Loads the object module is placed on into selected vehicle.
*
* Arguments:
* 0: Module logic <OBJECT>
* 1: Synchronized units <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* None
*
* Example:
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleUnloadFromCargo
*
* Public: No
*/
if (canSuspend) exitWith {
[FUNC(moduleUnloadFromCargo), _this] call CBA_fnc_directCall;
};
params ["_logic"];
if !(local _logic) exitWith {};
private _vehicle = attachedTo _logic;
deleteVehicle _logic;
if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
};
if (isNull _vehicle) exitWith {
[LSTRING(NothingSelected)] call FUNC(showMessage);
};
if (!alive _vehicle) exitWith {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
};
if ((_vehicle getVariable [QEGVAR(cargo,loaded), []]) isEqualTo []) exitWith {
[LSTRING(paradrop_noCargoLoaded)] call FUNC(showMessage);
};
EGVAR(cargo,interactionVehicle) = _vehicle;
EGVAR(cargo,interactionParadrop) = false;
createDialog QEGVAR(cargo,menu);