{"name":"BIS_fnc_loadInventory","title":"BIS fnc loadInventory","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_loadInventory","revid":349482,"updated":"2023-11-08T17:09:03Z","groups":["Inventory"],"status":"ok","games":{"arma3":"0.58"},"since":"arma3 0.58","arma3_since":"0.58","description":"Adds a predefined loadout (either via `CfgVehicles`, `CfgRespawnInventory`, or a custom inventory saved via BIS_fnc_saveInventory) to a specified unit.","syntaxes":[{"syntax":"param call BIS_fnc_loadInventory","params":[{"name":"Object","description":"unit to receive the loadout","type_expr":"Object"},{"name":"Config or Array","description":"can be one of:\n\n- Config: config entry of loadout found in either `CfgVehicles` or `CfgRespawnInventory`\n- Array in format [Namespace, Group or Object, String] or BIS_fnc_saveInventory's output","type_expr":"Config | Array"},{"name":"Array","optional":true,"default":"`[]`","description":"array of Strings that define what part of the loadout to ignore, e.g [\"weapons\", \"uniform\"]","type_expr":"Array","text":"Array - (Optional, default `[]`) array of Strings that define what part of the loadout to ignore, e.g [\"weapons\", \"uniform\"]"}],"returns":{"type":"Boolean","type_expr":"Boolean"}}],"examples":[{"code":["_loadout = [player, configFile >> \"CfgVehicles\" >> \"B_Soldier_SL_F\"] call BIS_fnc_loadInventory; // gives BLUFOR Squad Leader's loadout to player unit"]},{"text":"to save and load the inventory:\n\n```sqf\n[player, [missionNamespace, \"TAG_SavedInventory\"]] call BIS_fnc_saveInventory;    // save it\n[player, [missionNamespace, \"TAG_SavedInventory\"]] call BIS_fnc_loadInventory;    // load it\n```","code":["[player, [missionNamespace, \"TAG_SavedInventory\"]] call BIS_fnc_saveInventory;\t// save it\n[player, [missionNamespace, \"TAG_SavedInventory\"]] call BIS_fnc_loadInventory;\t// load it"]}],"see_also":["BIS_fnc_saveInventory","BIS_fnc_exportInventory","BIS_fnc_deleteInventory","setUnitLoadout"],"notes":[{"user":"Ilias38rus","date":"2020-08-02T15:21:00Z","text":"Doesn't work for backpacks in backpack, unlike setUnitLoadout."}]}