ACE3/addons/captives/functions/fnc_canStopEscorting.sqf

42 lines
732 B
Plaintext
Raw Normal View History

2015-02-04 19:16:19 +00:00
/*
* Author: PabstMirror
* Tests if player can stop escorting
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* -
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
DEFAULT_PARAM(1,_target,objNull);
private ["_isAttached"];
if (isNull _target) then {
_target = _unit getVariable ["ACE_escortedUnit", objNull];
};
if (isNull _target) exitWith {
ERROR("Null Target (no ACE_escortedUnit)");
false
};
_isAttached = _target in (attachedObjects _unit);
2015-02-05 22:39:45 +00:00
if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith {
2015-02-04 19:16:19 +00:00
ERROR("Attached But Not Captive");
false
};
_isAttached