BIS_fnc_invCodeToArray

From Bohemia Interactive Community
Revision as of 15:52, 25 July 2014 by Str (talk | contribs) (1 revision)
Jump to navigation Jump to search


Hover & click on the images for description

Description

Description:
/*
	File: fn_invSlotsEmpty.sqf

	Description:
	Converts inventory code (used in configs) to array with numbers for weapons and magazines (and their counts).
		
	Parameter(s):
	1: <scalar | empty> config code
	
	Returns:
	<array> items (slots) numbers
	
	
	Function:
	 input (result of): [1  +  4  + 12*  256  + 2* 4096  +  2  + 8* 16  + 12*131072]	 
	 output: [1,1,1,8,12,2,0,12]
	  - means: 1 x WeaponSlotPrimary, 1 x WeaponSlotHangun, ... , 12 x WeaponSlotInventory
	  
	 input: []
	 output: [0,0,0,0,0,0,0,0]

*/


//returned array gives numbers of following:
//mirrored from core config: cfg\Bin\cfgWeapons.hpp
#define WeaponSlotPrimary        1        // primary weapons
#define WeaponSlotHandGun        2        // HandGun
#define WeaponSlotSecondary        4        // secondary weapons
#define WeaponSlotHandGunItem        16 // HandGun magazines
#define WeaponSlotItem                256        // items
#define WeaponSlotBinocular        4096        // binocular
#define WeaponHardMounted        65536
#define WeaponSlotInventory 131072 // inventory items


(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Return Value:
Return value needed

Examples

Example 1:

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section