2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-15 16:25:48 +00:00
|
|
|
/*
|
2023-08-17 10:02:17 +00:00
|
|
|
* Author: kymckay, Glowbal
|
2015-08-15 16:25:48 +00:00
|
|
|
* Assigns a medic role from the medical module to a unit
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-15 20:11:49 +00:00
|
|
|
* 0: The module logic <OBJECT>
|
|
|
|
* 1: Synchronized units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
2015-08-15 16:25:48 +00:00
|
|
|
*
|
2015-08-15 20:11:49 +00:00
|
|
|
* Return Value:
|
2016-11-15 12:07:48 +00:00
|
|
|
* None
|
2015-08-15 16:25:48 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleSetMedicalFacility
|
|
|
|
*
|
2015-08-15 20:11:49 +00:00
|
|
|
* Public: No
|
2015-08-15 16:25:48 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
params ["_logic"];
|
2015-08-15 16:25:48 +00:00
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
if !(local _logic) exitWith {};
|
2015-08-15 16:25:48 +00:00
|
|
|
|
2024-06-18 00:07:38 +00:00
|
|
|
if !(GETEGVAR(medical,enabled,false)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(RequiresAddon)] call FUNC(showMessage);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
|
2015-08-15 16:25:48 +00:00
|
|
|
|
|
|
|
if ((_mouseOver select 0) != "OBJECT") then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(NothingSelected)] call FUNC(showMessage);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _unit = (_mouseOver select 1);
|
2015-08-15 16:25:48 +00:00
|
|
|
|
2015-08-15 20:44:40 +00:00
|
|
|
if (_unit isKindOf "Man" || {!(_unit isKindOf "Building")}) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyStructures)] call FUNC(showMessage);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _unit) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
|
|
|
if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyNonCaptive)] call FUNC(showMessage);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
2024-06-18 14:08:03 +00:00
|
|
|
if !(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false)) then {
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,isMedicalFacility), true, true];
|
2015-08-15 16:25:48 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|