addWeapon: Difference between revisions
Jump to navigation
Jump to search
m (Text replace - "{{uc:{{PAGENAME}}}}" to "{{uc:{{PAGENAME}}}} {{uc:{{PAGENAME}}}}") |
Killzone Kid (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Add a weapon to a unit. Infantry units can only carry a specific number of weapons, once the weapon slots are filled, any further addWeapon commands are ignored. |= Description | | Add a weapon to a unit. The unit must be [[local]]. For a global version of this command see [[addWeaponGlobal]]. | ||
Infantry units can only carry a specific number of weapons, once the weapon slots are filled, any further [[addWeapon]] commands are ignored. |= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | unit '''addWeapon''' weapon |= Syntax | ||
|p1= | |p1= unit: [[Object]] - unit or vehicle to add the weapon to |= Parameter 1 | ||
|p2= | |p2= weapon: [[String]] - weapon class name. See the topic [[:Category:Weapons]] for reference about possible values. |= Parameter 2 | ||
| [[Nothing]] |= Return value | | [[Nothing]] |= Return value | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= < | |x1= <code>[[player]] [[addMagazine]] "30Rnd_556x45_Stanag"; | ||
[[player]] [[addWeapon]] "BAF_L85A2_RIS_SUSAT";</code> |= Example 1 | |||
|x2= <code>An_2 [[addMagazine]] "100Rnd_762x51_M240"; | |||
An_2 [[addWeapon]] "M240_veh";</code> |= Example 2 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[removeWeapon]], [[removeAllWeapons]], [[addMagazine]] |= See also | | [[addWeaponGlobal]], [[removeWeapon]], [[removeAllWeapons]], [[addMagazine]] |= See also | ||
}} | }} |
Revision as of 11:29, 7 August 2013
Description
- Description:
- Add a weapon to a unit. The unit must be local. For a global version of this command see addWeaponGlobal. Infantry units can only carry a specific number of weapons, once the weapon slots are filled, any further addWeapon commands are ignored.
- Groups:
- Uncategorised
Syntax
- Syntax:
- unit addWeapon weapon
- Parameters:
- unit: Object - unit or vehicle to add the weapon to
- weapon: String - weapon class name. See the topic Category:Weapons for reference about possible values.
- Return Value:
- Nothing
Examples
- Example 1:
player addMagazine "30Rnd_556x45_Stanag"; player addWeapon "BAF_L85A2_RIS_SUSAT";
- Example 2:
An_2 addMagazine "100Rnd_762x51_M240"; An_2 addWeapon "M240_veh";
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
- Posted on August 2, 2006 - 10:19
- hardrock
- Notes from before the conversion: To ensure that the weapon is loaded at the start of the mission, add at least one magazine (addMagazine) before adding the weapon. To remove weapons use the removeAllWeapons or the removeWeapon commands.
- talkingtoaj
- When adding a weapon in-game, a bug means that sometimes the weapon can't be fired. Swap to a different weapon and swap back again to enable the newly added weapon to fire; or drop and pick up the weapon again.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands: Global Effect
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.46
- Scripting Commands ArmA
- Command Group: Weapons
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters