ACE3/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf

37 lines
1.0 KiB
Plaintext
Raw Normal View History

/*
* Author: Glowbal
* Action for loading an unconscious or dead unit in the nearest vehicle, or _vehicle if given.
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: The vehicle <OBJECT> (default: objNull)
*
* Return Value:
* Vehicle they are loaded into (objNull on failure) <OBJECT>
*
* Example:
* [bob, kevin] call ACE_medical_treatment_treatment_fnc_actionLoadUnit
*
* Public: No
*/
#include "script_component.hpp"
params ["_caller", "_target", ["_vehicle", objNull]];
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-10-13 19:21:42 +00:00
if ([_target] call FUNC(isBeingCarried)) then {
[_caller, _target] call EFUNC(dragging,dropObject_carry);
};
2016-10-13 19:21:42 +00:00
if ([_target] call FUNC(isBeingDragged)) then {
[_caller, _target] call EFUNC(dragging,dropObject);
};
private _vehicle = [_caller, _target, _vehicle] call EFUNC(common,loadPerson);
2016-10-13 19:21:42 +00:00
_vehicle