2015-02-03 02:04:50 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Unit unloads a captive from a vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit that wants to unload a captive <OBJECT>
|
|
|
|
* 1: Vehicle to unload a captive from. <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
2015-02-06 23:03:56 +00:00
|
|
|
* [bob, car] call ACE_captives_fnc_doUnloadCaptive
|
2015-02-03 02:04:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
PARAMS_2(_unit,_vehicle);
|
|
|
|
|
|
|
|
private ["_cargo", "_target"];
|
|
|
|
|
|
|
|
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
|
|
|
|
|
2015-02-05 22:39:45 +00:00
|
|
|
_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
|
2015-02-03 02:04:50 +00:00
|
|
|
|
2015-02-04 05:13:44 +00:00
|
|
|
if ((count _cargo) > 0) then {
|
2015-02-03 06:42:34 +00:00
|
|
|
_target = _cargo select 0;
|
2015-02-04 05:56:51 +00:00
|
|
|
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent);
|
2015-02-04 05:13:44 +00:00
|
|
|
} else {
|
|
|
|
ERROR("No captive to unload");
|
2015-02-03 02:04:50 +00:00
|
|
|
};
|