mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Common - Clean up ace_common_fnc_hasItem
& ace_common_fnc_hasMagazine
functions (#10108)
* Clean up hasItem & hasMagazine functions * Replace EFUNC * Update fnc_hasItem.sqf
This commit is contained in:
parent
7b0e5b6416
commit
dae2c5b465
@ -1,21 +1,21 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if unit has item. Note: case-sensitive.
|
||||
* Check if given unit has an item of given classname. Note: Case sensitive.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Item Classname <STRING>
|
||||
* 1: Item classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Unit has Item <BOOL>
|
||||
* Unit has item <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [bob, "item"] call ace_common_fnc_hasItem
|
||||
* [player, "ACE_Banana"] call ace_common_fnc_hasItem
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_item", "", [""]]];
|
||||
|
||||
_item in (_unit call EFUNC(common,uniqueItems))
|
||||
_item in (_unit call FUNC(uniqueItems)) // return
|
||||
|
@ -1,23 +1,21 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if given unit has a magazine of given classname
|
||||
* Check if given unit has a magazine of given classname. Note: Case sensitive.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Magazine Classname <STRING>
|
||||
* 1: Magazine classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* has Magazine <BOOL>
|
||||
* Unit has magazine <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [bob, "magazine"] call ace_common_fnc_hasMagazine
|
||||
* [player, "30Rnd_65x39_caseless_mag"] call ace_common_fnc_hasMagazine
|
||||
*
|
||||
* Public: yes
|
||||
*
|
||||
* Note: Case sensitive
|
||||
*/
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]];
|
||||
|
||||
_magazine in magazines _unit // return
|
||||
_magazine in ([_unit, 2] call FUNC(uniqueItems)) // return
|
||||
|
Loading…
Reference in New Issue
Block a user