Soldier.addMagazine 108

Adds a magazine to the soldier's invetory.


Return value

Return TypeDescription
boolReturns true if the magazine has been added succesfully.

Parameters

ParameterTypeDescription
1stringThe id of the magazine to give to the soldier
2integer(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

Back to Scripting API