{"name":"setVehicleAmmo","title":"setVehicleAmmo","type":"command","url":"https://community.bistudio.com/wiki/setVehicleAmmo","revid":376973,"updated":"2026-01-01T06:03:41Z","groups":["Vehicle Inventory"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Sets how much ammunition (compared to a full state defined by the vehicle type) the vehicle has. Note that the ammo will be added only to local turrets. To check locality of turret use turretLocal.","syntaxes":[{"syntax":"vehicleName setVehicleAmmo value","params":[{"name":"vehicleName","type":"Object","type_expr":"Object"},{"name":"value","type":"Number in range 0..1","description":"0: empty, 1: full","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"vehicleName"},"right":{"text":"value"}}],"examples":[{"code":["player setVehicleAmmo 0;"]},{"code":["_vehicle setVehicleAmmo 1;"]}],"see_also":["setVehicleAmmoDef","ammo","setAmmo","setAmmoCargo","turretLocal"],"notes":[{"user":"Ceeeb","text":"This command does not add magazines to vehicle weapons that normally start with more than one magazine. It can however, remove these magazines."},{"user":"Bon_Inf*","text":"A2:OA v1.59 - Magazines of vehicle turrets are also refilled by this command."},{"user":".kju","text":"- If you 'unit/vehicle setVehicleAmmo 0;' an unit/vehicle first, you cannot refill it with 'unit/vehicle setVehicleAmmo 1;'.\n- You need to execute where the unit is local.\n- You need to execute on the effectiveCommander of a vehicle."},{"user":"Galzohar","text":"- In Arma 3, using this command seems correctly rearm the vehicle and its turrets in all situations (tested with beta 0.72)."},{"user":"Killzone_Kid","text":"- In Arma 3, when using this on a player, this command can only reduce the number of magazine in relation to the current ammo quantity of the unit. For example if player has 8 magazines, player setVehicleAmmo 0.5; will leave unit with 4 mags. Executing player setVehicleAmmo 0.5; again will leave unit with 2 mags. player setVehicleAmmo 0.5; again -> 1 mag. player setVehicleAmmo 0; will remove all mags. If player had 10 mags with 30 bullets in each, player setVehicleAmmo 0.01; will leave player with loaded mag with 3 bullets in it (300 x 0.01 = 3)"},{"user":"Actium","date":"2014-12-20T21:55:00Z","text":"This command does not operate *compared to a full state defined by the vehicle type*, but rather relative to a vehicle's current magazine loadout. To get the former behaviour use setVehicleAmmoDef, which utilizes the vehicles default magazine loadout (i.e. its CfgVehicles magazines[] values)."}]}