2015-02-04 19:16:19 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2015-02-05 22:39:45 +00:00
|
|
|
* Checks the conditions for being able to apply handcuffs
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: caller (player) <OBJECT>
|
|
|
|
* 1: target <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* The return value <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2015-02-06 23:03:56 +00:00
|
|
|
* [player, bob] call ACE_captives_fnc_canApplyHandcuffs
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-04 23:15:20 +00:00
|
|
|
params ["_unit", "_target"];
|
2015-06-03 01:50:27 +00:00
|
|
|
//Check sides, Player has cableTie, target is alive and not already handcuffed
|
2015-02-05 22:39:45 +00:00
|
|
|
|
2015-06-03 01:50:27 +00:00
|
|
|
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
|
2015-10-23 19:17:31 +00:00
|
|
|
{"ACE_CableTie" in (items _unit)} &&
|
2015-02-06 09:38:27 +00:00
|
|
|
{alive _target} &&
|
2015-08-07 12:49:01 +00:00
|
|
|
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
2015-09-19 18:58:34 +00:00
|
|
|
{
|
|
|
|
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
|
2017-09-19 18:21:30 +00:00
|
|
|
{!GVAR(requireSurrenderAi) && {!([_target] call EFUNC(common,isPlayer))}} || //is an AI (not a player) and doesn't require surrendering
|
2015-09-19 18:58:34 +00:00
|
|
|
{GVAR(requireSurrender) == 0} || //or don't require surrendering
|
|
|
|
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
|
|
|
|
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
|
|
|
|
}
|