diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index 8f503d8fd0..f69bb2544d 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canApplyHandcuffs * * Public: No */ diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 3d026e3d54..cbb098881f 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -4,13 +4,13 @@ * * Arguments: * 0: caller (player) - * 1: target + * 1: target * * Return Value: * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canEscortCaptive * * Public: No */ diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf index 9bbf5389c3..28a9ee0134 100644 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ b/addons/captives/functions/fnc_canFriskPerson.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canFriskPerson * * Public: No */ diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 902ec36331..04b33ad42d 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -11,7 +11,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canLoadCaptive * * Public: No */ diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index d36042b0ab..4642cd90fd 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canRemoveHandcuffs * * Public: No */ diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index bb48244a25..e6a5a0e568 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_canStopEscorting * * Public: No */ @@ -21,7 +21,6 @@ DEFAULT_PARAM(1,_target,objNull); private ["_isAttached"]; - if (isNull _target) then { _target = _unit getVariable [QGVAR(escortedUnit), objNull]; }; diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 60dcd7c938..238087c62b 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * [player, true] call ACE_captives_fnc_canSurrender; + * [Jean, true] call ACE_captives_fnc_canSurrender; * * Public: No */ diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 3e014d72c7..a86bdae588 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -11,7 +11,7 @@ * The return value * * Example: - * - + * [player, bob, car1] call ACE_captives_fnc_canUnloadCaptive; * * Public: No */ diff --git a/addons/captives/functions/fnc_doApplyHandcuffs.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf index 6c44df3dc5..8abf8c836c 100644 --- a/addons/captives/functions/fnc_doApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * - + * [player, bob] call ACE_captives_fnc_doApplyHandcuffs; * * Public: No */ diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index fbbcd09947..299aa81631 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -11,7 +11,7 @@ * The return value * * Example: - * - + * [player, bob, true] call ACE_captives_fnc_doEscorteCaptive; * * Public: No */ diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index d69dbd045c..14b18ffd0e 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -10,7 +10,7 @@ * Nothing * * Example: - * TODO + * [player, bob] call ACE_captives_fnc_doFristPerson; * * Public: No */ diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 92d1adecf8..9fd65a130d 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -11,7 +11,7 @@ * Nothing * * Example: - * TODO + * [bob, tom, car] call ACE_captives_fnc_doLoadCaptive * * Public: No */ diff --git a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf index 01ca4ef436..a69decf620 100644 --- a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -1,16 +1,15 @@ /* * Author: PabstMirror - * Release a captive + * Remove handcuffs from a target * * Arguments: - * 0: caller (player) - * 1: target + * 0: target * * Return Value: * The return value * * Example: - * - + * [bob, false] call ACE_captives_fnc_doRemoveHandcuffs * * Public: No */ diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index b4814fc564..b7fa57a7bb 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -10,7 +10,7 @@ * Nothing * * Example: - * TODO + * [bob, car] call ACE_captives_fnc_doUnloadCaptive * * Public: No */ diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index eb3a9ad8b1..54133e2362 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -11,7 +11,7 @@ * The return value * * Example: - * - + * [car2, x, player] call ACE_captives_fnc_handleGetIn * * Public: No */ diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index b212377dd2..4bf9a1fa19 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -11,7 +11,7 @@ * The return value * * Example: - * - + * [car2, x, player] call ACE_captives_fnc_handleGetOut * * Public: No */ @@ -30,4 +30,4 @@ if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { }; [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); -}; \ No newline at end of file +}; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 219bd2eb60..9e9c5e1ac8 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -9,7 +9,7 @@ * None * * Example: - * - + * [bob1] call ACE_captives_fnc_handleKilled * * Public: No */ @@ -24,3 +24,7 @@ if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { _oldUnit setVariable [QGVAR(isEscorting), false, true]; }; + +if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then { + _oldUnit setVariable [QGVAR(isSurrendering), false, true]; +}; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index af6472c211..9c4f02546f 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -10,7 +10,7 @@ * The return value * * Example: - * TODO + * [bob1, bob2] call ACE_captives_fnc_handlePlayerChange * * Public: No */ @@ -18,7 +18,7 @@ PARAMS_2(_newUnit,_oldUnit); -if (_newUnit getVariable [QGVAR(isHandcuffed), false]) then { +if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then { showHUD false; } else { showHUD true; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index 635d7b0439..1a5a8f2ecd 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -9,7 +9,7 @@ * The return value * * Example: - * TODO + * [bob] call ACE_captives_fnc_handleUnitInitPost * * Public: No */ diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf index af59b5c56e..9bf2e1a2bc 100644 --- a/addons/captives/functions/fnc_handleWokeUp.sqf +++ b/addons/captives/functions/fnc_handleWokeUp.sqf @@ -9,7 +9,7 @@ * The return value * * Example: - * TODO + * [bob] call ACE_captives_fnc_handleWokeUp * * Public: No */ diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 1be72ca7c9..cf03704a85 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -10,7 +10,7 @@ * Nothing * * Example: - * TODO + * [bob, true] call ACE_captives_fnc_setHandcuffed; * * Public: No */ diff --git a/addons/captives/functions/fnc_surrender.sqf b/addons/captives/functions/fnc_surrender.sqf index bb782d85da..8b9d870cd5 100644 --- a/addons/captives/functions/fnc_surrender.sqf +++ b/addons/captives/functions/fnc_surrender.sqf @@ -10,7 +10,7 @@ * Nothing * * Example: - * TODO + * [Pierre, true] call ACE_captives_fnc_surrender; * * Public: No */ @@ -19,12 +19,18 @@ PARAMS_2(_unit,_state); if (_state) then { - if (_unit getVariable [QGVAR(isSurrendering), false]) exitWith {}; + if (_unit getVariable [QGVAR(isSurrendering), false]) exitWith { + ERROR("Already Surrendering"); + }; _unit setVariable [QGVAR(isSurrendering), true, true]; [_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); + if (_unit == ACE_player) then { + showHUD false; + }; + private "_surrenderFnc"; _surrenderFnc = { EXPLODE_1_PVT((_this select 0),_unit); @@ -49,7 +55,7 @@ if (_state) then { }; [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); - + if (_unit == ACE_player) then { //only enable if not handcuffed if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then { diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index dd3b6e6818..626a0b34e4 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -10,7 +10,7 @@ * Nothing * * Example: - * TODO + * [bob, car1] call ACE_captives_fnc_vehicleCaptiveMoveIn; * * Public: No */ @@ -24,5 +24,3 @@ _target moveInCargo _vehicle; _target assignAsCargo _vehicle; _cargoIndex = _vehicle getCargoIndex _target; _target setVariable [QGVAR(CargoIndex), _cargoIndex, true]; - -TRACE_3("moveinEH",_target,_vehicle,_cargoIndex); diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index 4210e8da15..5ef6f01406 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -9,7 +9,7 @@ * Nothing * * Example: - * TODO + * [bob] call ACE_captives_fnc_vehicleCaptiveMoveOut; * * Public: No */ @@ -21,4 +21,4 @@ _unit setVariable [QGVAR(CargoIndex), -1, true]; moveOut _unit; [_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); -unassignVehicle _unit; \ No newline at end of file +unassignVehicle _unit;