{"name":"currentMuzzle","operator":null,"title":"currentMuzzle","type":"command","url":"https://community.bistudio.com/wiki/currentMuzzle","revid":321269,"updated":"2022-05-13T19:08:05Z","groups":["Weapons"],"status":"ok","replaced_by":[],"games":[{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns a unit's current weapon muzzle. Does not work on vehicles.","syntaxes":[{"syntax":"currentMuzzle unit","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"}],"returns":{"type":"String","types":["String"],"description":"current muzzle > [!IMPORTANT] > In earlier games/versions, this command could return a Number (`0`) if unit was in a vehicle. > Use the following to circumvent the issue: > > ```sqf > _muzzle = weaponState unit select 1; > ```","text":"String - current muzzle\n\n> [!IMPORTANT]\n> In earlier games/versions, this command could return a Number (`0`) if *unit* was in a vehicle.\n> Use the following to circumvent the issue:\n>\n> ```sqf\n> _muzzle = weaponState unit select 1;\n> ```"},"form":"unary","operator":null,"left":null,"right":{"text":"unit","types":["Object"]}}],"examples":[{"text":"```sqf\n_muzzle = currentMuzzle player;\n```","code":["_muzzle = currentMuzzle player;"]},{"text":"```sqf\n_muzzle = currentMuzzle (gunner (vehicle player));\n```","code":["_muzzle = currentMuzzle (gunner (vehicle player));"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["currentWeapon","currentMagazine","currentThrowable"],"notes":[],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Command Group: Weapons","Introduced with Arma 2: Operation Arrowhead version 1.50","Scripting Commands","Take On Helicopters: Scripting Commands"]}