ACE3/addons/medical/functions/fnc_actionLoadUnit.sqf

39 lines
1.0 KiB
Plaintext
Raw Normal View History

2015-03-01 09:44:08 +00:00
/*
* 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:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller", "_target","_vehicle", "_loaded"];
_caller = _this select 0;
_target = _this select 1;
if ([_target] call EFUNC(common,isAwake)) exitwith {
2015-03-07 12:57:36 +00:00
// TODO localization
2015-03-01 09:44:08 +00:00
["displayTextStructured", [_caller], [["This person (%1) is awake and cannot be loaded", [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
};
if ([_target] call FUNC(isBeingCarried)) then {
2015-04-20 20:08:31 +00:00
[_caller, _target] call FUNC(dropObject_carry);
};
if ([_target] call FUNC(isBeingDragged)) then {
2015-04-20 20:08:31 +00:00
[_caller, _target] call FUNC(dropObject);
};
2015-03-01 09:44:08 +00:00
_vehicle = [_caller, _target] call EFUNC(common,loadPerson);
if (!isNull _vehicle) then {
if (!isnil QGVAR(DROP_ADDACTION)) then {
_caller removeAction GVAR(DROP_ADDACTION);
GVAR(DROP_ADDACTION) = nil;
};
};