ACE3/addons/medical/functions/fnc_actionLoadUnit.sqf
Ozan Eğitmen 45a66ccfa1 Medical & Captive Load Menu Overhaul (#5519)
* Add load in child actions to medical & captive

* Add actions with proper structure

* Move vehicles actions code to common function

* Simplify code in config, Fix docs

* Remove unused vars

* Fix header example

* Add _distance param to fnc_nearestVehiclesFreeSeat

* Change docs

* Fix spacing
2017-09-29 22:00:47 +02:00

34 lines
934 B
Plaintext

/*
* 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:
* None
*
* Example:
* [bob, kevin] call ACE_medical_fnc_actionLoadUnit
*
* Public: No
*/
#include "script_component.hpp"
params ["_caller", "_target", ["_vehicle", objNull]];
if ([_target] call EFUNC(common,isAwake)) exitWith {
[QEGVAR(common,displayTextStructured), [[LSTRING(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);
};
[_caller, _target, _vehicle] call EFUNC(common,loadPerson);