setAmmo: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " {3,}\|" to " |") |
Lou Montana (talk | contribs) m (Text replacement - "{{Command " to "{{RV|type=command ") |
||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma3 | | arma3 |
Revision as of 21:31, 23 January 2021
Description
- Description:
- Description needed
- Groups:
- Unit InventoryVehicle Inventory
Syntax
- Syntax:
- Syntax needed
- Parameters:
- unit: Object - Gunner or vehicle.
- [weapon, count]: Array
- weapon: String
- count: Number
- Return Value:
- Return value needed
Examples
- Example 1:
- Set player's handgun magazine ammo count to 10 rounds:
player setAmmo [handgunWeapon player, 10];
- Example 2:
- Set player's current weapon magazine ammo count to 1 round:
player setAmmo [currentWeapon player, 1];
- Example 3:
- If player is a gunner in a vehicle, set current weapon magazine ammo count to 5 rounds:
if (local vehicle player) then { vehicle player setAmmo [currentWeapon vehicle player, 5]; } else { hint "Vehicle must be local to this machine for 'setAmmo' to work"; };
- Example 4:
- If you try to set more ammo than the magazine can hold, it will be clipped at default magazine capacity:
player setAmmo [primaryWeapon player, 1000000]; //full mag with default ammo count
Additional Information
- See also:
- See also needed
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