BIS fnc loadInventory: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Fixed param, syntax, examples.)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>/*
| Adds a predefined loadout (either via CfgVehicles, CfgRespawnInventory, or a custom inventory saved via [[BIS_fnc_saveInventory]]) to a specified unit. |= Description
 
Description:
Add config defined inventory to an unit
 
Parameter(s):
0: OBJECT - object which will receive the loadout
1:
CONFIG - link to CfgVehicles soldier or to CfgRespawnInventory
ARRAY in format [NAMESPACE or GROUP or OBJECT,STRING] - inventory saved using BIS_fnc_saveInventory
2: ARRAY of STRINGs - config entries to be ignored (e.g. "weapons", "uniform", ...)
 
Returns:
BOOL
*/
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_loadInventory]]; --> |= Syntax
| param call [[BIS_fnc_loadInventory]]; |= Syntax


|p1= |= Parameter 1
|p1= [[Object]] - Unit to receive the loadout. |= Parameter 1
|p2= [[Config]] - Config entry of loadout found in either CfgVehicles or CfgRespawnInventory, OR:
* [[Array]] in format [[Namespace]], [[Group]], [[Object]] or [[String]] - usable with inventories saved via [[BIS_fnc_saveInventory]]. |=
|p3= [[Array]] - Array of [[String|Strings]] that define what part of the loadout to ignore. Example "weapons", "uniform". ''Optional parameter''.


| Bool |= Return value
| [[Boolean]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>[soldier1, [ [[missionNamespace]], "loadout"]] [[call]] [[BIS_fnc_saveInventory]]; //save inventory into variable called "loadout".
|x1= <code>loadout = [player,configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // Gives loadout of BLUFOR Squad Leader to player unit.</code> |=
[ [[player]], [ [[missionNamespace]], "loadout"]] [[call]] [[BIS_fnc_loadInventory]]; //load inventory from variable "loadout" onto player</code> |=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 21:35, 29 September 2014


Hover & click on the images for description

Description

Description:
Adds a predefined loadout (either via CfgVehicles, CfgRespawnInventory, or a custom inventory saved via BIS_fnc_saveInventory) to a specified unit.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
param call BIS_fnc_loadInventory;
Parameters:
Object - Unit to receive the loadout.
Config - Config entry of loadout found in either CfgVehicles or CfgRespawnInventory, OR:
Array - Array of Strings that define what part of the loadout to ignore. Example "weapons", "uniform". Optional parameter.
Return Value:
Boolean

Examples

Example 1:
loadout = [player,configfile >> "CfgVehicles" >> "B_Soldier_SL_F"] call BIS_fnc_loadInventory; // Gives loadout of BLUFOR Squad Leader to player unit.

Additional Information

See also:
BIS_fnc_saveInventoryBIS_fnc_exportInventoryBIS_fnc_deleteInventory

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