ACE3/addons/captives/functions/fnc_canEscortCaptive.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

28 lines
624 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Tests if can escort target (attach)
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canEscortCaptive
*
* Public: No
*/
params ["_unit", "_target"];
//Alive, handcuffed, not being escored, and not unconscious
(_target getVariable [QGVAR(isHandcuffed), false]) &&
{isNull (attachedTo _target)} &&
{alive _target} &&
{!(_target getVariable ["ACE_isUnconscious", false])} &&
{(vehicle _unit) == _unit} &&
{(vehicle _target) == _target}