2015-08-15 16:25:48 +00:00
|
|
|
/*
|
|
|
|
* Author: SilentSpike, Glowbal
|
|
|
|
* 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:
|
|
|
|
* None <NIL>
|
2015-08-15 16:25:48 +00:00
|
|
|
*
|
2015-08-15 20:11:49 +00:00
|
|
|
* Public: No
|
2015-08-15 16:25:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_logic", "_units", "_activated"];
|
2015-08-15 20:11:49 +00:00
|
|
|
private ["_mouseOver", "_unit", "_medicN"];
|
2015-08-15 16:25:48 +00:00
|
|
|
|
|
|
|
if !(_activated && local _logic) exitWith {};
|
|
|
|
|
2015-08-15 18:31:41 +00:00
|
|
|
if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
|
2015-08-15 16:25:48 +00:00
|
|
|
[LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured);
|
|
|
|
} else {
|
|
|
|
_mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
|
|
|
|
|
|
|
|
if ((_mouseOver select 0) != "OBJECT") then {
|
|
|
|
[LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured);
|
|
|
|
} else {
|
|
|
|
_unit = (_mouseOver select 1);
|
|
|
|
|
2015-08-15 20:44:40 +00:00
|
|
|
if (_unit isKindOf "Man" || {_unit isKindOf "Building"}) then {
|
|
|
|
[LSTRING(OnlyVehicles)] call EFUNC(common,displayTextStructured);
|
2015-08-15 16:25:48 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _unit) then {
|
|
|
|
[LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured);
|
|
|
|
} else {
|
|
|
|
if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then {
|
|
|
|
[LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured);
|
|
|
|
} else {
|
|
|
|
_medicN = GETVAR(_unit,EGVAR(medical,medicClass),0);
|
|
|
|
if (_medicN < 1) then {
|
|
|
|
_unit setvariable [QEGVAR(medical,medicClass), 1, true];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|