{"name":"fire","operator":null,"title":"fire","type":"command","url":"https://community.bistudio.com/wiki/fire","revid":369149,"updated":"2024-09-03T10:34:38Z","groups":["Unit Control","Weapons"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Forces a unit to fire the given weapon.\n\n> [!NOTE]\n> Just like with forceWeaponFire it is possible to pass remote unit as argument, but this could be unreliable. Considering this command might need to be used in combination with selectWeapon, which takes only local arguments, it would make sense to execute the fire command where the unit is local as well.","syntaxes":[{"syntax":"unit fire muzzle","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"unit that is supposed to fire","types":["Object"],"since":null,"text":"unit: Object - unit that is supposed to fire"},{"name":"muzzle","type":"String","optional":false,"default":null,"description":"name of the muzzle to be fired","types":["String"],"since":null,"text":"muzzle: String - name of the muzzle to be fired"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"muzzle","types":["String"]}},{"syntax":"unit fire [muzzle, mode, magazine]","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"muzzle","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"muzzle: String"},{"name":"mode","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"mode: String"},{"name":"magazine","type":"String","optional":true,"default":null,"description":null,"types":["String"],"since":null,"text":"magazine: String - (Optional)"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[muzzle, mode, magazine]","types":["Array"]}}],"examples":[{"text":"```sqf\n_soldier fire \"M16\";\n```","code":["_soldier fire \"M16\";"]},{"text":"```sqf\n_soldier fire \"SmokeShellMuzzle\";\n```","code":["_soldier fire \"SmokeShellMuzzle\";"]},{"text":"```sqf\n_soldier fire [\"SmokeShellMuzzle\", \"SmokeShellMuzzle\", \"SmokeShellRed\"];\n```","code":["_soldier fire [\"SmokeShellMuzzle\", \"SmokeShellMuzzle\", \"SmokeShellRed\"];"]},{"text":"```sqf\nplayer playActionNow \"PutDown\";\nplayer selectWeapon \"DemoChargeMuzzle\";\nplayer fire [\"DemoChargeMuzzle\", \"DemoChargeMuzzle\", \"DemoCharge_Remote_Mag\"];\nplayer setWeaponReloadingTime [player, \"DemoChargeMuzzle\", 0];\n```","code":["player playActionNow \"PutDown\";\nplayer selectWeapon \"DemoChargeMuzzle\";\nplayer fire [\"DemoChargeMuzzle\", \"DemoChargeMuzzle\", \"DemoCharge_Remote_Mag\"];\nplayer setWeaponReloadingTime [player, \"DemoChargeMuzzle\", 0];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_fire","doFire","commandFire","canFire","fireAtTarget","forceWeaponFire","commandArtilleryFire","commandSuppressiveFire","doArtilleryFire","doSuppressiveFire","isManualFire","selectWeapon","ArmA: Actions"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Control","Command Group: Weapons","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}