2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-09-26 22:29:19 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Adds a Spare Wheel to the vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The module logic <OBJECT>
|
|
|
|
* 1: Synchronized units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddSpareWheel
|
|
|
|
*
|
2015-09-26 22:29:19 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
params ["_logic"];
|
2015-09-26 22:29:19 +00:00
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
if !(local _logic) exitWith {};
|
2015-09-26 22:29:19 +00:00
|
|
|
|
|
|
|
if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(RequiresAddon)] call FUNC(showMessage);
|
2015-09-26 22:29:19 +00:00
|
|
|
} else {
|
|
|
|
(GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"];
|
|
|
|
|
|
|
|
if (_mouseOverType != "OBJECT") then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(NothingSelected)] call FUNC(showMessage);
|
2015-09-26 22:29:19 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _mouseOverUnit) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
2015-09-26 22:29:19 +00:00
|
|
|
} else {
|
2023-11-17 23:07:28 +00:00
|
|
|
if ("ACE_Wheel" call EFUNC(cargo,getSizeItem) > _mouseOverUnit call EFUNC(cargo,getCargoSpaceLeft)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyEnoughCargoSpace)] call FUNC(showMessage);
|
2015-09-26 22:29:19 +00:00
|
|
|
} else {
|
2023-11-17 23:07:28 +00:00
|
|
|
["ace_addCargo", ["ACE_Wheel", _mouseOverUnit, 1]] call CBA_fnc_localEvent;
|
2015-09-26 22:29:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|