ACE3/addons/zeus/functions/fnc_moduleSetRepairVehicle.sqf
mharis001 bca8b01860 Various additions to ace_zeus (#6036)
* Add search to teleport players UI

* Change group side icons to look better

* Improve teleport UI and add stringtable entries

* Add Assign Repair Vehicle module

* Add Assign Repair Facility module

* Add Assign Engineer module

* Add Full Heal module

* Add Suicide Bomber module

* Make heal module work without ace_medical

* Add suicide bomber module translations

* Improve attribute cargo to use displayName

* Improve set engineer ui

* ACE_Curator for repair modules + author array

* Add angle param to getModuleDestination

* Prevent multiple suicide bomber modules on same target

* Heal module: support BI scripted revive system

* Requested changes
2018-02-24 11:44:57 -06:00

47 lines
1.1 KiB
Plaintext

/*
* Author: mharis001
* Assigns object as repair vehicle.
*
* Arguments:
* 0: The module logic <OBJECT>
*
* Return Value:
* None
*
* Example:
* [LOGIC] call ace_zeus_fnc_moduleSetRepairVehicle
*
* Public: No
*/
#include "script_component.hpp"
params ["_logic"];
if !(local _logic) exitWith {};
if !(["ace_repair"] call EFUNC(common,isModLoaded)) then {
[LSTRING(RequiresAddon)] call FUNC(showMessage);
} else {
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
if ((_mouseOver select 0) != "OBJECT") then {
[LSTRING(NothingSelected)] call FUNC(showMessage);
} else {
private _unit = _mouseOver select 1;
if (_unit isKindOf "Man" || (_unit isKindOf "Building")) then {
[LSTRING(OnlyVehicles)] call FUNC(showMessage);
} else {
if !(alive _unit) then {
[LSTRING(OnlyAlive)] call FUNC(showMessage);
} else {
if !([_unit] call EFUNC(repair,isRepairVehicle)) then {
_unit setVariable ["ACE_isRepairVehicle", 1, true];
};
};
};
};
};
deleteVehicle _logic;