setAmmo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *G([a-z ])" to "$1 - g$2") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *W([a-z ])" to "$1 - w$2") |
||
Line 18: | Line 18: | ||
|p1= unit: [[Object]] - gunner or vehicle. | |p1= unit: [[Object]] - gunner or vehicle. | ||
|p2= weaponOrMuzzle: [[String]] - | |p2= weaponOrMuzzle: [[String]] - weapon name. Muzzle name in case the weapon has more than one muzzle, e.g. weapon with grenade launcher. See [[:Category:Weapons|CfgWeapons]] for muzzle names | ||
|p3= count: [[Number]] | |p3= count: [[Number]] |
Revision as of 16:35, 8 November 2023
Description
- Description:
- Sets custom ammo count in the currently loaded magazine of the specified weapon or muzzle.
- Groups:
- Unit InventoryVehicle Inventory
Syntax
- Syntax:
- unit setAmmo [weaponOrMuzzle, count]
- Parameters:
- unit: Object - gunner or vehicle.
- weaponOrMuzzle: String - weapon name. Muzzle name in case the weapon has more than one muzzle, e.g. weapon with grenade launcher. See CfgWeapons for muzzle names
- count: Number
- Return Value:
- Nothing
Examples
- Example 1:
- Set player's handgun magazine ammo count to 10 rounds:
- Example 2:
- Set player's current weapon magazine ammo count to 1 round:
- Example 3:
- If player is a gunner in a vehicle, set current weapon magazine ammo count to 5 rounds:
- Example 4:
- If you try to set more ammo than the magazine can hold, it will be clipped at default magazine capacity:
- Example 5:
- Some weapons has more than one muzzles:
_marshall setAmmo ["autocannon_40mm_CTWS", 0];// won't work _marshall setAmmo ["HE", 0];// works
Additional Information
- See also:
- ammo setVehicleAmmo setFuel setHit
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