setUnitLoadout: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(fixed typo)
(corrections)
Line 4: Line 4:
| Creates a loadout from given inventory structure and applies it to a unit.
| Creates a loadout from given inventory structure and applies it to a unit.


| unit [[setUnitLoadout]] [Loadout structure, Full magazines]|= Syntax
| unit [[setUnitLoadout]] [loadout, rearm]|= Syntax
|p1= Unit: [[Object]] |= Parameter 1
|p1= unit: [[Object]] |= Parameter 1
|p2= Loadout structure: [[Array]] |= Parameter 2
|p2= loadout: [[Array]] - loadout array from [[getUnitLoadout]] |= Parameter 2
|p3= Full magazines: [[Boolean]] - Partially emptied magazines will be refilled when the loadout is applied - Default: true (optional)|= Parameter3
|p3= rearm: [[Boolean]] - Partially emptied magazines will be refilled when the loadout is applied - Default: [[false]] (optional)|= Parameter3
| Nothing |= RETURNVALUE  
| Nothing |= RETURNVALUE  
|x1= <code>_loadout [[getUnitLoadout]] player_1 ;
|x1= <code>_loadout = [[getUnitLoadout]] player_1 ;
player_2 [[setUnitLoadout]] _loadout;//Copies loadout from player_1 and applies it to player_2 </code>|= EXAMPLE1  
player_2 [[setUnitLoadout]] _loadout;//Copies loadout from player_1 and applies it to player_2 </code>|= EXAMPLE1  



Revision as of 16:39, 19 April 2016

-wrong parameter ("arma3 dev") defined!-[[:Category:Introduced with arma3 dev version 1.59|1.59]]
Hover & click on the images for description

Description

Description:
Creates a loadout from given inventory structure and applies it to a unit.
Groups:
Uncategorised

Syntax

Syntax:
unit setUnitLoadout [loadout, rearm]
Parameters:
unit: Object
loadout: Array - loadout array from getUnitLoadout
rearm: Boolean - Partially emptied magazines will be refilled when the loadout is applied - Default: false (optional)
Return Value:
Nothing

Examples

Example 1:
_loadout = getUnitLoadout player_1 ; player_2 setUnitLoadout _loadout;//Copies loadout from player_1 and applies it to player_2

Additional Information

See also:
getUnitLoadout

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

[[Category:Introduced with arma3 dev version 1.59]][[ Category: arma3 dev: New Scripting Commands | SETUNITLOADOUT]][[ Category: arma3 dev: Scripting Commands | SETUNITLOADOUT]]

Bottom Section

Notes

Bottom Section