BIS fnc addRespawnInventory: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (changed "unit" to "soldier")
 
(41 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.60


| arma3 |= Game name
|gr1= Respawn


|1.00|= Game version
|eff= global
____________________________________________________________________________________________


| <pre>/*
|descr= Add a respawn inventory for [[Arma 3: Respawn#MenuInventory|respawn menu]].<br>
Available loadouts are defined in [[Description.ext#CfgRespawnInventory|CfgRespawnInventory]]. Or you may use an existing CfgVehicles soldier class as reference.


Description:
|s1= [target, inventoryParams] call [[BIS_fnc_addRespawnInventory]]
Add a respawn loadout


Parameter(s):
|p1= target: Receiver of the respawn loadout
0:
* [[Namespace]] - use [[missionNamespace]] to add the loadout to everyone
NAMESPACE
* [[Side]]
SIDE
* [[Group]]
GROUP
* [[Object]]
OBJECT
1: STRING - CfgRespawnInventory or CfgVehicles class


Returns:
|p2= inventoryParams: [[Array]] or [[String]]
ARRAY in format [target,id] (used in BIS_fnc_removeRespawnInventory)
* [[String]] - [[Description.ext#CfgRespawnInventory|CfgRespawnInventory]] class or [[CfgVehicles]] soldier class
*/
* [[Array]] - format [class, number, limit]
** class: [[String]] - [[Description.ext#CfgRespawnInventory|CfgRespawnInventory]] class or [[CfgVehicles]] soldier class
** number: [[Number]] - Number of players who can use this inventory (-1 = no limit, default)
** limit: [[Number]] - Limit for role assigned to given loadout (-1 = no limit, default)  
*** Only role or only loadout can be limited at one moment, if there is limit for both, then only role uses limit.
*** If the limit definition for role is called multiple times with different numbers, then the highest number is used.


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|r1= [[Array]] - format [target, id] used in [[BIS_fnc_removeRespawnInventory]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_addRespawnInventory]]; --> |= Syntax
|x1= <sqf>[west, "WEST1"] call BIS_fnc_addRespawnInventory;</sqf>


|p1= |= Parameter 1
|x2= <sqf>private _myRespawnInventory = [missionNamespace, "ATSniper"] call BIS_fnc_addRespawnInventory;</sqf>
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <code></code> |=
____________________________________________________________________________________________
 
| |= See also


|seealso= [[Arma 3: Respawn]] [[BIS_fnc_removeRespawnInventory]] [[BIS_fnc_getRespawnInventories]] [[BIS_fnc_setRespawnInventory]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Respawn|{{uc:addRespawnInventory}}]]
[[Category:Functions|{{uc:addRespawnInventory}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:addRespawnInventory}}]]

Latest revision as of 06:10, 6 September 2024

Hover & click on the images for description

Description

Description:
Add a respawn inventory for respawn menu.
Available loadouts are defined in CfgRespawnInventory. Or you may use an existing CfgVehicles soldier class as reference.
Execution:
call
Groups:
Respawn

Syntax

Syntax:
[target, inventoryParams] call BIS_fnc_addRespawnInventory
Parameters:
target: Receiver of the respawn loadout
inventoryParams: Array or String
  • String - CfgRespawnInventory class or CfgVehicles soldier class
  • Array - format [class, number, limit]
    • class: String - CfgRespawnInventory class or CfgVehicles soldier class
    • number: Number - Number of players who can use this inventory (-1 = no limit, default)
    • limit: Number - Limit for role assigned to given loadout (-1 = no limit, default)
      • Only role or only loadout can be limited at one moment, if there is limit for both, then only role uses limit.
      • If the limit definition for role is called multiple times with different numbers, then the highest number is used.
Return Value:
Array - format [target, id] used in BIS_fnc_removeRespawnInventory

Examples

Example 1:
[west, "WEST1"] call BIS_fnc_addRespawnInventory;
Example 2:
private _myRespawnInventory = [missionNamespace, "ATSniper"] call BIS_fnc_addRespawnInventory;

Additional Information

See also:
Arma 3: Respawn BIS_fnc_removeRespawnInventory BIS_fnc_getRespawnInventories BIS_fnc_setRespawnInventory

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