ACE3/addons/captives/functions/fnc_canStopEscorting.sqf

28 lines
612 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-02-04 19:16:19 +00:00
/*
* Author: PabstMirror
* Tests if player can stop escorting.
2015-02-04 19:16:19 +00:00
*
* Arguments:
* 0: Caller (player) <OBJECT>
* 1: Target <OBJECT> (default: objNull)
2015-02-04 19:16:19 +00:00
*
* Return Value:
* Can unit stop escorting another unit <BOOL>
2015-02-04 19:16:19 +00:00
*
* Example:
2015-02-06 23:03:56 +00:00
* [player, bob] call ACE_captives_fnc_canStopEscorting
2015-02-04 19:16:19 +00:00
*
* Public: No
*/
params ["_unit", ["_target", objNull]];
2015-02-04 19:16:19 +00:00
if (isNull _target) then {
2015-02-06 05:11:28 +00:00
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
2015-02-04 19:16:19 +00:00
};
if (isNull _target) exitWith {false};
2015-02-04 19:16:19 +00:00
(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}