ACE3/addons/attach/functions/fnc_canAttach.sqf
2015-01-11 21:39:49 +01:00

22 lines
457 B
Plaintext

#include "script_component.hpp"
/*
* Author: commy2
*
* Check if a unit can attach a specific item.
*
* Argument:
* 0: Unit that wants to attach the object (Object)
* 1: Name of the attachable item (String)
*
* Return value:
* Boolean (Bool)
*/
private ["_unit", "_item"];
_unit = _this select 0;
_item = _this select 1;
canStand _unit && {_unit getVariable [QGVAR(ItemName), ""] == ""} && {_item in (magazines _unit + items _unit + [""])}