ACE3/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf
PabstMirror bec55114fa Add load,unload and radial actions (#5270)
- Add radial actions
- Revert back to using 'ACE_isUnconscious'
2017-06-15 14:35:33 -05:00

36 lines
935 B
Plaintext

/*
* Author: Glowbal
* Action for loading an unconscious or dead unit in the nearest vechile
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* 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"];
if (_target call EFUNC(common,isAwake)) exitWith {
[QEGVAR(common,displayTextStructured), [[ELSTRING(medical,CanNotLoaded), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent;
};
if (_target call FUNC(isBeingCarried)) then {
[_caller, _target] call EFUNC(dragging,dropObject_carry);
};
if (_target call FUNC(isBeingDragged)) then {
[_caller, _target] call EFUNC(dragging,dropObject);
};
private _vehicle = [_caller, _target] call EFUNC(common,loadPerson);
_vehicle