ACE3/addons/captives/functions/fnc_handleGetOut.sqf

34 lines
791 B
Plaintext
Raw Normal View History

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-02-03 06:42:34 +00:00
* 2: dunno <OBJECT>
2015-02-03 02:04:50 +00:00
* 1: _unit <OBJECT>
*
* 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-02-03 06:42:34 +00:00
PARAMS_3(_vehicle,_dontcare,_unit);
2015-02-05 22:39:45 +00:00
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
2015-02-04 06:35:51 +00:00
private ["_cargoIndex"];
2015-02-06 09:38:27 +00:00
_cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1];
2015-02-04 06:35:51 +00:00
//If captive was not "unloaded", then move them back into the vehicle.
if (_cargoIndex != -1) exitWith {
_unit moveInCargo [_vehicle, _cargoIndex];
};
2015-02-03 02:04:50 +00:00
2015-02-04 06:35:51 +00:00
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
2015-02-06 23:03:56 +00:00
};