addWeaponGlobal

From Bohemia Interactive Community
Jump to: navigation, search
Introduced with Arma 3 version 0.76
  Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
0.76

Description

Description:
Add a weapon to a unit. Infantry units can only carry weapons in their respective slots (primary, secondary and handgun), the addWeaponGlobal command will replace the weapon currently in a slot with the added weapon if it shares the same slot. To make sure the added weapon is loaded and ready, add the magazine first.
warning.png This command is broken when used on dedicated server

Syntax

Syntax:
unit addWeaponGlobal weapon
Parameters:
unit: Object - unit or vehicle to add the weapon to
weapon: String - weapon class name
Return Value:
Nothing

Examples

Example 1:
{ _x addMagazineGlobal "Laserbatteries"; _x addWeaponGlobal "Laserdesignator"; } forEach allUnits;
Example 2:
{ if (typeOf _x == "O_Heli_Attack_02_black_F") then { _x addMagazineGlobal "38Rnd_80mm_rockets"; _x addWeaponGlobal "rockets_Skyfire"; }; } forEach vehicles;

Additional Information

Multiplayer:
-
See also:
removeWeaponGlobaladdWeaponaddMagazineaddMagazineGlobal

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section

Posted on July 7, 2015 - 18:42 (UTC)
Killzone Kid
If you do not remove weapon first, using this command from dedicated server will duplicate weapon.