Soldier.addNewItem 152
Adds an item to the soldier's inventory
Return value
| Return Type | Description |
|---|---|
| bool | Returns true if the item has been added to the soldier's inventory successfully |
Parameters
| Parameter | Type | Description |
|---|---|---|
| 1 | string | The id of the item to add |
| 2 | bool | (Optional) Should the soldier wear the clothing / equip the weapon item. Default is false |
Examples
Example 119
local soldier = er2.getPlayer()
soldier.addNewItem("jap_infantry_helmet_4_net", true) -- Adds to the player a japanese helmet and force equips it
Equip item to soldier
local soldier = er2.getPlayer()
soldier.addNewItem("m60", true) -- Adds an M60 to the player and force equips it