{"name":"forceWeaponFire","operator":null,"title":"forceWeaponFire","type":"command","url":"https://community.bistudio.com/wiki/forceWeaponFire","revid":369347,"updated":"2024-09-03T18:43:03Z","groups":["Unit Control","Weapons"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"The unit will be forced to fire weapon from the given muzzle. The weapon will not fire if firemode passed as parameter is not supported by the given muzzle. The muzzle could belong to a vehicle weapon and unit in this case will be the unit operating this weapon. Doesnt't seem to work for units in FFV positions. Works on player. See also: BIS_fnc_fire","syntaxes":[{"syntax":"unit forceWeaponFire [muzzle, firemode]","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"unit alone or in vehicle","types":["Object"],"since":null,"text":"unit: Object - unit alone or in vehicle"},{"name":"muzzle","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"muzzle: String"},{"name":"firemode","type":"String","optional":false,"default":null,"description":"common options are \"Single\", \"Burst\", \"FullAuto\". For the full list of a weapon firemodes:\n\n```sqf\nhint str (getArray (configFile >> \"CfgWeapons\" >> currentWeapon player >> \"modes\"));\n```\n\n If *modes[]* param in config for the weapon says *{\"this\"}*, then the same classname as for the weapon param (currentWeapon player) should be used as firemode param.","types":["String"],"since":null,"text":"firemode: String - common options are \"Single\", \"Burst\", \"FullAuto\". For the full list of a weapon firemodes:\n\n```sqf\nhint str (getArray (configFile >> \"CfgWeapons\" >> currentWeapon player >> \"modes\"));\n```\n\n If *modes[]* param in config for the weapon says *{\"this\"}*, then the same classname as for the weapon param (currentWeapon player) should be used as firemode param."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[muzzle, firemode]","types":["Array"]}}],"examples":[{"text":"```sqf\n_unit forceWeaponFire [\"arifle_MX_F\", \"Single\"];\n_unit forceWeaponFire [\"hgun_ACPC2_F\", \"hgun_ACPC2_F\"];\n_unit forceWeaponFire [\"HandGrenadeMuzzle\",\"HandGrenadeMuzzle\"];\n_unit forceWeaponFire [\"MiniGrenadeMuzzle\",\"MiniGrenadeMuzzle\"];\n_unit forceWeaponFire [\"HandGrenade_Stone\",\"HandGrenade_Stone\"];\n_unit forceWeaponFire [\"SmokeShellMuzzle\",\"SmokeShellMuzzle\"];\n_unit forceWeaponFire [\"ChemlightGreenMuzzle\",\"ChemlightGreenMuzzle\"];\n_unit forceWeaponFire [\"IRGrenade\",\"IRGrenade\"];\n_unit forceWeaponFire [\"Laserdesignator\",\"Laserdesignator\"];\n```","code":["_unit forceWeaponFire [\"arifle_MX_F\", \"Single\"];\n_unit forceWeaponFire [\"hgun_ACPC2_F\", \"hgun_ACPC2_F\"];\n_unit forceWeaponFire [\"HandGrenadeMuzzle\",\"HandGrenadeMuzzle\"];\n_unit forceWeaponFire [\"MiniGrenadeMuzzle\",\"MiniGrenadeMuzzle\"];\n_unit forceWeaponFire [\"HandGrenade_Stone\",\"HandGrenade_Stone\"];\n_unit forceWeaponFire [\"SmokeShellMuzzle\",\"SmokeShellMuzzle\"];\n_unit forceWeaponFire [\"ChemlightGreenMuzzle\",\"ChemlightGreenMuzzle\"];\n_unit forceWeaponFire [\"IRGrenade\",\"IRGrenade\"];\n_unit forceWeaponFire [\"Laserdesignator\",\"Laserdesignator\"];"]},{"text":"```sqf\ngunner blackfoot forceWeaponFire [\"gatling_20mm\", \"close\"];\n```","code":["gunner blackfoot forceWeaponFire [\"gatling_20mm\", \"close\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["currentWeapon","currentWeaponMode","setWeaponReloadingTime","selectWeapon","fire","doFire","commandFire","canFire","fireAtTarget","commandArtilleryFire","commandSuppressiveFire","doArtilleryFire","doSuppressiveFire","isManualFire","BIS_fnc_fire"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Control","Command Group: Weapons","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Global Effect"]}