Difference between revisions of "VN ms fnc hasItems"
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "[[vn_" to "[[VN_") |
Lou Montana (talk | contribs) m (typo) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
{{Function | {{Function | ||
Line 6: | Line 5: | ||
|author= Wyqer, veteran29 | |author= Wyqer, veteran29 | ||
− | |a= | + | |a= global |
|e= | |e= | ||
Line 12: | Line 11: | ||
|g1= general | |g1= general | ||
− | |d= | + | |d= Checks if given units have at least one of one or each given item in their inventory. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | |s= [unitsOrGroups, itemClasses, allItems] call [[VN_ms_fnc_hasItems]] | |
− | |||
− | + | |p1n= unitsOrGroups | |
− | + | |p1t= array | |
− | + | |p1d= groups and/or units to be scanned | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |p1n= | ||
− | |p1t= | ||
− | |p1d= | ||
|p1v= | |p1v= | ||
− | |p2n= | + | |p2n= itemClasses |
− | |p2t= | + | |p2t= array |
− | |p2d= | + | |p2d= '''case-sensitive''' classname(s) of item(s) to be found |
|p2v= | |p2v= | ||
− | |r1t= | + | |p3n= allItems |
+ | |p3t= boolean | ||
+ | |p3d= if set to false, only one of the listed items needs to be found | ||
+ | |p3v= true | ||
+ | |||
+ | |r1t= boolean | ||
|r1d= | |r1d= | ||
− | |x1= <code> | + | |x1= <code>{{cc|All listed items need to be at least once in the inventory}} |
+ | [<nowiki/>[player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"]] call [[VN_ms_fnc_hasItems]];</code> | ||
+ | |||
+ | |x2= <code>{{cc|One of the listed items needs to be at least once in the inventory}} | ||
+ | [<nowiki/>[player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"], false] call [[VN_ms_fnc_hasItems]];</code> | ||
}} | }} |
Latest revision as of 21:48, 23 February 2021
← back to Functions | Introduced in S.O.G. Prairie Fire v1.00 by Wyqer, veteran29 |
|
Description
Checks if given units have at least one of one or each given item in their inventory.
Syntax
- Syntax
- [unitsOrGroups, itemClasses, allItems] call VN_ms_fnc_hasItems
- Parameters
- unitsOrGroups: Array - groups and/or units to be scanned
- itemClasses: Array - case-sensitive classname(s) of item(s) to be found
- allItems: Boolean - (Optional, default
true
) if set to false, only one of the listed items needs to be found - Return value
- Boolean
Examples
- Example 1
// All listed items need to be at least once in the inventory [[player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"]] call VN_ms_fnc_hasItems;
- Example 2
// One of the listed items needs to be at least once in the inventory [[player], ["vn_mine_m18_mag", "vn_mine_m18_x3_mag"], false] call VN_ms_fnc_hasItems;