{"name":"setMagazineTurretAmmo","operator":null,"title":"setMagazineTurretAmmo","type":"command","url":"https://community.bistudio.com/wiki/setMagazineTurretAmmo","revid":377488,"updated":"2026-01-02T06:49:09Z","groups":["Turrets"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.34"}],"since":{"game":"arma3","name":"Arma 3","version":"1.34"},"arma3_since":"1.34","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Sets ammo count to given amount for given turret magazine.\n\n> [!NOTE]\n> Arma 3 v2.18 The magazine is first checked if it is loaded into the turret weapon, if not, the command falls back to old behaviour of selecting the first magazine from the list of available magazines.\n> In most cases it will be the loaded magazine.\n\n> [!IMPORTANT]\n> The turret itself **must** be local (see turretLocal, turretOwner).","syntaxes":[{"syntax":"vehicle setMagazineTurretAmmo [magazineClass, ammoCount, turretPath]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicle: Object"},{"name":"magazineClass","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"magazineClass: String"},{"name":"ammoCount","type":"Number","optional":false,"default":null,"description":null,"types":["Number"],"since":null,"text":"ammoCount: Number"},{"name":"turretPath","type":"Turret Path","optional":false,"default":null,"description":"[-1] for driver turret is supported","types":["Turret Path"],"since":null,"text":"turretPath: Turret Path - [-1] for driver turret is supported"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[magazineClass, ammoCount, turretPath]","types":["Array"]}}],"examples":[{"text":"```sqf\nmyMRAP setMagazineTurretAmmo [\"200Rnd_127x99_mag_Tracer_Red\", 30, [0]];\n```","code":["myMRAP setMagazineTurretAmmo [\"200Rnd_127x99_mag_Tracer_Red\", 30, [0]];"]},{"text":"Set ammo count on commander turret from server:\n\n```sqf\n_tank = tank;\n_turret = [0,0];\n_magazine = \"200Rnd_127x99_mag_Tracer_Red\";\n_ammo = 10;\n[_tank, [_magazine, _ammo, _turret]] remoteExec [\"setMagazineTurretAmmo\", _tank turretOwner _turret];\n```","code":["_tank = tank;\n_turret = [0,0];\n_magazine = \"200Rnd_127x99_mag_Tracer_Red\";\n_ammo = 10;\n[_tank, [_magazine, _ammo, _turret]] remoteExec [\"setMagazineTurretAmmo\", _tank turretOwner _turret];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["magazineTurretAmmo","setAmmoOnPylon","turretLocal","turretOwner"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Turrets","Introduced with Arma 3 version 1.34","Scripting Commands"]}