BIS fnc saveInventory: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - " |s1=[" to " |s1= [")
m (Some wiki formatting)
 
(12 intermediate revisions by the same user not shown)
Line 8: Line 8:
|descr= Save unit's loadout.
|descr= Save unit's loadout.


|s1= [unit,input,params,delete] call [[BIS_fnc_saveInventory]]
|s1= [unit, input, params, delete] call [[BIS_fnc_saveInventory]]


|p1= unit: [[Object]] - Unit whose inventory should be saved
|p1= unit: [[Object]] - unit whose inventory should be saved
|p2= input: [[Array]] in format:
*1: [[Namespace]], [[Group]] or [[Object]] - Target where the loadout is stored
*2: [[String]] - Loadout name
|p3= params: [[Array]] - (Optional, default [ ]) Custom parameters stored with the loadout
|p4= delete: [[Boolean]] - (Optional, default [[false]]) Whether or not to delete the loadout


|r1= [[Array]] - Saved value
|p2= input: [[Array]] format [target, loadoutName]:
* target: [[Namespace]], [[Group]] or [[Object]] - target where the loadout is stored
* loadoutName: [[String]] - loadout name


|x1= <code>[ [[player]], [<nowiki/>[[missionNamespace]], "BIS_inv"], [], true ] [[call]] [[BIS_fnc_saveInventory]];</code>
|p3= params: [[Array]] - (Optional, default []) custom parameters stored with the loadout


|seealso= [[BIS_fnc_loadInventory]][[BIS_fnc_exportInventory]][[BIS_fnc_deleteInventory]] [[getUnitLoadout]]
|p4= delete: [[Boolean]] - (Optional, default [[false]]) whether or not to delete the loadout
}}


|r1= [[Array]] - saved value


<dl class="command_description">
|x1= <sqf>[player, [missionNamespace, "BIS_inv"], [], true] call BIS_fnc_saveInventory;</sqf>


<dt></dt>
|seealso= [[BIS_fnc_loadInventory]][[BIS_fnc_exportInventory]][[BIS_fnc_deleteInventory]] [[getUnitLoadout]]
<dd class="notedate">Posted on August 2, 2020 - 15:22 (UTC)</dd>
}}
<dt class="note">[[User:Ilias38rus|Ilias38rus]]</dt>
<dd class="note">
Doesn't work for backpacks in backpack, unlike [[getUnitLoadout]].
</dd>


</dl>
{{Note
|user= Ilias38rus
|timestamp= 20200802152200
|text= Doesn't work for backpacks in backpack, unlike [[getUnitLoadout]].
}}

Latest revision as of 23:43, 10 May 2026

Hover & click on the images for description

Description

Description:
Save unit's loadout.
Execution:
call
Groups:
Inventory

Syntax

Syntax:
[unit, input, params, delete] call BIS_fnc_saveInventory
Parameters:
unit: Object - unit whose inventory should be saved
input: Array format [target, loadoutName]:
params: Array - (Optional, default []) custom parameters stored with the loadout
delete: Boolean - (Optional, default false) whether or not to delete the loadout
Return Value:
Array - saved value

Examples

Example 1:
[player, [missionNamespace, "BIS_inv"], [], true] call BIS_fnc_saveInventory;

Additional Information

See also:
BIS_fnc_loadInventoryBIS_fnc_exportInventoryBIS_fnc_deleteInventory getUnitLoadout

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note
Ilias38rus - c
Posted on Aug 02, 2020 - 15:22 (UTC) §
Doesn't work for backpacks in backpack, unlike getUnitLoadout.