2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2017-09-29 20:00:47 +00:00
|
|
|
* Action for loading an unconscious or dead unit in the nearest vehicle, or _vehicle if given.
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
2017-09-29 20:00:47 +00:00
|
|
|
* 2: The vehicle <OBJECT> (default: objNull)
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-15 19:35:33 +00:00
|
|
|
* Vehicle they are loaded into (objNull on failure) <OBJECT>
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
2019-03-30 16:07:54 +00:00
|
|
|
* [bob, kevin] call ace_medical_treatment_treatment_fnc_actionLoadUnit
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
2016-07-15 10:23:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-09-29 20:00:47 +00:00
|
|
|
params ["_caller", "_target", ["_vehicle", objNull]];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2015-11-30 16:14:05 +00:00
|
|
|
if ([_target] call EFUNC(common,isAwake)) exitWith {
|
2016-10-13 19:21:42 +00:00
|
|
|
[QEGVAR(common,displayTextStructured), [[ELSTRING(medical,CanNotLoaded), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent;
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
2016-10-13 19:21:42 +00:00
|
|
|
|
2018-05-08 09:16:12 +00:00
|
|
|
if ([_target] call EFUNC(medical_status,isBeingCarried)) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
[_caller, _target] call EFUNC(dragging,dropObject_carry);
|
|
|
|
};
|
2016-10-13 19:21:42 +00:00
|
|
|
|
2018-05-08 09:16:12 +00:00
|
|
|
if ([_target] call EFUNC(medical_status,isBeingDragged)) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
[_caller, _target] call EFUNC(dragging,dropObject);
|
|
|
|
};
|
|
|
|
|
2017-10-03 03:29:30 +00:00
|
|
|
private _vehicle = [_caller, _target, _vehicle] call EFUNC(common,loadPerson);
|
2019-03-17 16:54:50 +00:00
|
|
|
if (!isNull _vehicle) then {
|
|
|
|
private _hint = LSTRING(loadedInto);
|
|
|
|
private _itemName = [_target, false, true] call EFUNC(common,getName);
|
|
|
|
private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
|
|
|
|
[[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured);
|
|
|
|
};
|
2016-10-13 19:21:42 +00:00
|
|
|
|
|
|
|
_vehicle
|