addWeaponGlobal: Difference between revisions
Jump to navigation
Jump to search
SilentSpike (talk | contribs) m (made terminology consistent) |
Lou Montana (talk | contribs) m (Text replacement - "|= Game name" to "|Game name=") |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Command|= | {{Command|Comments= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| arma3 | | | arma3 |Game name= | ||
|0.76| | |0.76|Game version= | ||
|arg= global |= | |arg= global |Multiplayer Arguments= | ||
|eff= global |= | |eff= global |Multiplayer Effects= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| 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. | | 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. |= | To make sure the added weapon is loaded and ready, add the magazine first. | ||
{{warning | This command is broken when used on dedicated server}} |DESCRIPTION= | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| unit '''addWeaponGlobal''' weapon |= | | unit '''addWeaponGlobal''' weapon |SYNTAX= | ||
|p1= unit: [[Object]] - unit or vehicle to add the weapon to |= | |p1= unit: [[Object]] - unit or vehicle to add the weapon to |PARAMETER1= | ||
|p2= weapon: [[String]] - weapon class name |= | |p2= weapon: [[String]] - weapon class name |PARAMETER2= | ||
| [[Nothing]] |= | | [[Nothing]] |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 28: | Line 29: | ||
_x [[addMagazineGlobal]] "Laserbatteries"; | _x [[addMagazineGlobal]] "Laserbatteries"; | ||
_x [[addWeaponGlobal]] "Laserdesignator"; | _x [[addWeaponGlobal]] "Laserdesignator"; | ||
} [[forEach]] [[allUnits]];</code> |= | } [[forEach]] [[allUnits]];</code> |EXAMPLE1= | ||
|x2= <code>{ | |x2= <code>{ | ||
Line 35: | Line 36: | ||
_x [[addWeaponGlobal]] "rockets_Skyfire"; | _x [[addWeaponGlobal]] "rockets_Skyfire"; | ||
}; | }; | ||
} [[forEach]] [[vehicles]];</code> |= | } [[forEach]] [[vehicles]];</code> |EXAMPLE2= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[removeWeaponGlobal]], [[addWeapon]], [[addMagazine]], [[addMagazineGlobal]] |= | | [[removeWeaponGlobal]], [[addWeapon]], [[addMagazine]], [[addMagazineGlobal]] |SEEALSO= | ||
}} | }} | ||
Line 53: | Line 54: | ||
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Broken Scripting Commands|{{uc:{{PAGENAME}}}}]] | |||
<!-- CONTINUE Notes --> | |||
<dl class="command_description"> | |||
<dd class="notedate">Posted on July 7, 2015 - 18:42 (UTC)</dd> | |||
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt> | |||
<dd class="note"> | |||
If you do not remove weapon first, using this command from dedicated server will duplicate weapon. | |||
</dd> | |||
</dl> | |||
<!-- DISCONTINUE Notes --> |
Revision as of 02:34, 31 August 2019
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.
- Groups:
- Uncategorised
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
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
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.