ACE3/addons/common/functions/fnc_useMagazine.sqf
2015-05-14 17:12:40 -05:00

28 lines
667 B
Plaintext

/**
* fn_useMagazine.sqf
* @Descr: Use magazine
* @Author: Glowbal
*
* @Arguments: [unit OBJECt, magazine STRING]
* @Return: BOOL True if magazine has been used.
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_return", "_vehicleUsage"];
PARAMS_2(_unit,_magazine);
_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param;
if (!_vehicleUsage) then {
if (_magazine != "") then {
_unit removeMagazine _magazine;
_return = true;
} else {
_return = false;
};
[format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug);
_return
} else {
// TODO implement shared magazine functionality
};