ACE3/addons/captives/functions/fnc_unloadCaptive.sqf

33 lines
748 B
Plaintext
Raw Normal View History

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:
* TODO
*
* 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.
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
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:13:44 +00:00
[QGVAR(MoveOut), [_target], [_target]] call EFUNC(common,targetEvent);
} else {
ERROR("No captive to unload");
2015-02-03 02:04:50 +00:00
};