ACE3/addons/medical/functions/fnc_actionLoadUnit.sqf

39 lines
1.3 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-03-01 09:44:08 +00:00
/*
* Author: Glowbal
* Action for loading an unconscious or dead unit in the nearest vehicle, or _vehicle if given.
2015-03-01 09:44:08 +00:00
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: The vehicle <OBJECT> (default: objNull)
2015-03-01 09:44:08 +00:00
*
* Return Value:
2015-08-22 14:25:10 +00:00
* None
2015-03-01 09:44:08 +00:00
*
* Example:
* [bob, kevin] call ACE_medical_fnc_actionLoadUnit
*
2015-03-01 09:44:08 +00:00
* Public: No
*/
params ["_caller", "_target", ["_vehicle", objNull]];
2015-03-01 09:44:08 +00:00
2015-11-30 16:14:05 +00:00
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;
2015-03-01 09:44:08 +00:00
};
if ([_target] call FUNC(isBeingCarried)) then {
2015-08-22 19:32:36 +00:00
[_caller, _target] call EFUNC(dragging,dropObject_carry);
};
if ([_target] call FUNC(isBeingDragged)) then {
2015-08-22 19:32:36 +00:00
[_caller, _target] call EFUNC(dragging,dropObject);
};
2015-03-01 09:44:08 +00:00
private _vehicle = [_caller, _target, _vehicle] call EFUNC(common,loadPerson);
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);
};