addMagazine

From BISim Wiki
Jump to: navigation, search


Introduced in vbs2 version 1.00

Template:localTemplate:global

Click on the images for descriptions


Introduced in

Version:1.00

Description

Description: Adds a magazine to a person. The number of magazines that can be added via this method is not limited by the magazine slots allotted to a unit (i.e. it is possible to add hundreds of magazines.)
When equipping a unit with a new weapon, executing addMagazine before the addWeapon command will cause the weapon to start out loaded already.

Syntax

Syntax: unitName addMagazine magazineName
Parameters:
  • unitName: Object - person to add the magazines to
  • magazineName: String - magazine name. See CfgMagazines for possible values.
Return Value: Nothing

Examples

Examples:
player addMagazine "M16"

Additional Information

See also: removeMagazine, removeMagazines, addWeapon
Multiplayer: 
Problems: 

Notes

Only post proven facts here. Use the talk page or the forums for discussions.



Notes

Posted on August 2, 2006 - 06:59
Hoz
If the unit has magazines already, you may need to use the commands removeMagazine or removeMagazines to make space for the mags you want to add.

Posted on February 21, 2010 - 20:13
Vigilante
In turreted vehicles the magazine is added to the first turret with >> primaryGunner = 1; << set in the Vehicles turret config part (and the magazine is ONLY added to the very first turret if more than one is configged with >> primaryGunner = 1; << ).

Posted on May 12, 2010 - 20:09
Inkompetent
When wanting to add many magazines to an object's init-line it can be easier to use loops than to just repeat the addMagazine command.

If you want to add N magazines to an object either of the two below ways are handy, the first for fewer magazines, and the latter when you want to add many since it then is the easiest of the two to read.

{this addMagazine "magazineClassName"} forEach [1,2,3,...,N];

for "_i" from 0 to N-1 do {this addMagazine "magazineClassName"};

Bottom Section

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox