ACE3/addons/common/functions/fnc_useItem.sqf
Phyma ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00

40 lines
764 B
Plaintext

/*
* Author: Glowbal
* Use item
*
* Arguments:
* 0: unit <OBJECT>
* 1: item <STRING>
*
* Return Value:
* if item has been used. <BOOL>
*
* Example:
* [bob, "gun"] call ace_common_fnc_useItem
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", "_item", ["_vehicleUsage", false]];
private _return = false;
if !(_vehicleUsage) then {
if (_item != "") then {
if (_item in items _unit) then {
_unit removeItem _item;
_return = true;
} else {
if (_item in assignedItems _unit) then {
_unit unlinkItem _item;
_return = true;
};
};
};
//} else {
// @todo implement shared item functionality for with vehicles.
};
_return