Soldier.addMagazine 127
Adds a magazine to the soldier's invetory.
Return value
| Return Type | Description |
|---|---|
| bool | Returns true if the magazine has been added succesfully. |
Parameters
| Parameter | Type | Description |
|---|---|---|
| 1 | string | The id of the magazine to give to the soldier |
| 2 | integer | (Optional) The number of bullets to put in the magazine (Default is 0). NOTE: You can set the magazine capacity to any value. To add magazines with ammo set at their default full capacity there are different functions. |
Examples
Example 121
local player = er2.getPlayer()
player.addMagazine("m60_mag", 500) -- Adds an M60 magazine with 500 bullets to the player's inventory