2015-02-03 02:04:50 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2015-02-03 06:42:34 +00:00
|
|
|
* Handles when a captive unit gets out of a vehicle.
|
2015-02-03 02:04:50 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: _vehicle <OBJECT>
|
2015-08-23 17:32:46 +00:00
|
|
|
* 1: dunno <OBJECT>
|
|
|
|
* 2: _unit <OBJECT>
|
2015-02-03 02:04:50 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* The return value <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-02-06 23:03:56 +00:00
|
|
|
* [car2, x, player] call ACE_captives_fnc_handleGetOut
|
2015-02-03 02:04:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-23 17:32:46 +00:00
|
|
|
params ["_vehicle", "", "_unit"];
|
|
|
|
TRACE_2("params",_vehicle,_unit);
|
2015-02-03 06:42:34 +00:00
|
|
|
|
2015-02-05 22:39:45 +00:00
|
|
|
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
|
2016-09-04 14:44:22 +00:00
|
|
|
private _cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1];
|
2015-02-06 09:38:27 +00:00
|
|
|
|
2015-08-23 17:32:46 +00:00
|
|
|
if (_cargoIndex != -1) then {
|
|
|
|
//If captive was not "unloaded", then move them back into the vehicle.
|
|
|
|
TRACE_1("forcing back into vehicle",_cargoIndex);
|
2015-02-04 06:35:51 +00:00
|
|
|
_unit moveInCargo [_vehicle, _cargoIndex];
|
2015-08-23 17:32:46 +00:00
|
|
|
} else {
|
|
|
|
//Getting out of vehicle:
|
|
|
|
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
|
|
|
|
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
2015-02-04 06:35:51 +00:00
|
|
|
};
|
2015-02-06 23:03:56 +00:00
|
|
|
};
|