ACE3/addons/medical/functions/fnc_addUnloadPatientActions.sqf

44 lines
1.0 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
* Create one unload action per unconscious passenger
*
2016-06-18 09:50:41 +00:00
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
2016-06-18 09:50:41 +00:00
* Return Value:
* Children actions <ARRAY>
*
* Example:
* [car, kevin, [params]] call ACE_medical_fnc_addUnloadPatientActions
*
* Public: No
*/
2015-08-22 14:25:10 +00:00
params ["_vehicle", "_player", "_parameters"];
2016-06-13 08:55:19 +00:00
private _actions = [];
{
2016-06-13 08:55:19 +00:00
private _unit = _x;
if (_unit != _player && {(alive _unit) && {_unit getVariable ["ACE_isUnconscious", false]}}) then {
_actions pushBack
[
[
str(_unit),
[_unit, true] call EFUNC(common,getName),
"",
2015-08-22 16:33:06 +00:00
{[_player, (_this select 2) select 0] call FUNC(actionUnloadUnit);},
{true},
{},
[_unit]
] call EFUNC(interact_menu,createAction),
[],
_unit
];
};
} forEach crew _vehicle;
_actions