{"name":"BIS_fnc_loadInventory","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.58"}],"since":{"game":"arma3","name":"Arma 3","version":"0.58"},"arma3_since":"0.58","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"Object","type":null,"optional":false,"default":null,"description":"unit to receive the loadout","types":["Object"],"since":null,"text":"Object - unit to receive the loadout"},{"name":"Config or Array","type":null,"optional":false,"default":null,"description":"can be one of:\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","types":["Config","Array"],"since":null,"text":"Config or Array - can be one of:\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"},{"name":"Array","type":null,"optional":true,"default":"`[]`","description":"array of Strings that define what part of the loadout to ignore, e.g [\"weapons\", \"uniform\"]","types":["Array"],"since":null,"text":"Array - (Optional, default `[]`) array of Strings that define what part of the loadout to ignore, e.g [\"weapons\", \"uniform\"]"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"}}],"examples":[{"text":"```sqf\n_loadout = [player, configFile >> \"CfgVehicles\" >> \"B_Soldier_SL_F\"] call BIS_fnc_loadInventory; // gives BLUFOR Squad Leader's loadout to player unit\n```","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"]}],"multiplayer":null,"problems":null,"aliases":[],"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."}],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Inventory","Functions","Introduced with Arma 3 version 0.58"],"docblock":null,"filled_from_docblock":[]}