{"name":"BIS_fnc_fire","operator":null,"title":"BIS fnc fire","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_fire","revid":347331,"updated":"2023-09-11T00:28:50Z","groups":["Weapons","Object Manipulation","Combat"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.74"}],"since":{"game":"arma3","name":"Arma 3","version":"1.74"},"arma3_since":"1.74","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Makes a unit or a vehicle fire given muzzle. Make sure that there is some ammo to fire, and, in case of a unit, the weapon with given muzzle is already selected. It can be used to fire pretty much any muzzle on unit or vehicle from anywhere. Available weapons could usually be found with weapons, weaponsTurret and allTurrets commands.","syntaxes":[{"syntax":"[entity, muzzle, turret] call BIS_fnc_fire","since":null,"effect":null,"exec":null,"params":[{"name":"entity","type":"Object","optional":false,"default":null,"description":"unit or vehicle","types":["Object"],"since":null,"text":"entity: Object - unit or vehicle"},{"name":"muzzle","type":"String","optional":false,"default":null,"description":"muzzle name of the muzzle to fire","types":["String"],"since":null,"text":"muzzle: String -  muzzle name of the muzzle to fire"},{"name":"turret","type":"Array","optional":true,"default":null,"description":"turret path of the turret with given muzzle (vehicles only)","types":["Array"],"since":null,"text":"turret: Array - (Optional) turret path of the turret with given muzzle (vehicles only)"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"in SP and on hosted server in MP or Nothing on client in MP. When boolean, true if all checks have passed and muzzle should have fired, false if there was a problem, like: - no ammo - non-existing muzzle - the muzzle is on a weapon that is not selected - the weapon has no unit operating it","text":"Boolean - in SP and on hosted server in MP or Nothing on client in MP. When boolean, true if all checks have passed and muzzle should have fired, false if there was a problem, like:\n- no ammo\n- non-existing muzzle\n- the muzzle is on a weapon that is not selected\n- the weapon has no unit operating it"}}],"examples":[{"text":"```sqf\nmarshall = \"B_APC_Wheeled_01_cannon_F\" createVehicle position player;\ncreateVehicleCrew marshall;\n\n[marshall, \"HE\"] call BIS_fnc_fire; // fires HE muzzle of the main cannon\n[marshall, \"AP\"] call BIS_fnc_fire; // fires AP muzzle of the main cannon\n[marshall, \"autocannon_40mm_CTWS\"] call BIS_fnc_fire; // fires HE muzzle, because it is default\n[marshall, \"LMG_M200_body\"] call BIS_fnc_fire; // fires machine gun\n[marshall, \"SmokeLauncher\"] call BIS_fnc_fire; // fires smoke launcher\n[marshall, \"TruckHorn\"] call BIS_fnc_fire; // beeps the horn\n```","code":["marshall = \"B_APC_Wheeled_01_cannon_F\" createVehicle position player;\ncreateVehicleCrew marshall;\n\n[marshall, \"HE\"] call BIS_fnc_fire; // fires HE muzzle of the main cannon\n[marshall, \"AP\"] call BIS_fnc_fire; // fires AP muzzle of the main cannon\n[marshall, \"autocannon_40mm_CTWS\"] call BIS_fnc_fire; // fires HE muzzle, because it is default\n[marshall, \"LMG_M200_body\"] call BIS_fnc_fire; // fires machine gun\n[marshall, \"SmokeLauncher\"] call BIS_fnc_fire; // fires smoke launcher\n[marshall, \"TruckHorn\"] call BIS_fnc_fire; // beeps the horn"]},{"text":"```sqf\n[bob, \"SmokeShellMuzzle\"] call BIS_fnc_fire;  // bob throws smoke grenade, if he has one\n[bob, \"HandGrenadeMuzzle\"] call BIS_fnc_fire; // bob throws hand grenade, if he has one\n```","code":["[bob, \"SmokeShellMuzzle\"] call BIS_fnc_fire;  // bob throws smoke grenade, if he has one\n[bob, \"HandGrenadeMuzzle\"] call BIS_fnc_fire; // bob throws hand grenade, if he has one"]},{"text":"```sqf\nblackfoot = \"B_Heli_Attack_01_dynamicLoadout_F\" createVehicle position player;\ncreateVehicleCrew blackfoot;\n\n[blackfoot, \"missiles_DAGR\"]   call BIS_fnc_fire; // fires missiles\n[blackfoot, \"missiles_ASRAAM\"] call BIS_fnc_fire; // fires missiles\n[blackfoot, \"gatling_20mm\"]    call BIS_fnc_fire; // fires machine gun\n[blackfoot, \"CMFlareLauncher\"] call BIS_fnc_fire; // fires chaff\n```","code":["blackfoot = \"B_Heli_Attack_01_dynamicLoadout_F\" createVehicle position player;\ncreateVehicleCrew blackfoot;\n\n[blackfoot, \"missiles_DAGR\"]   call BIS_fnc_fire; // fires missiles\n[blackfoot, \"missiles_ASRAAM\"] call BIS_fnc_fire; // fires missiles\n[blackfoot, \"gatling_20mm\"]    call BIS_fnc_fire; // fires machine gun\n[blackfoot, \"CMFlareLauncher\"] call BIS_fnc_fire; // fires chaff"]},{"text":"```sqf\n[vehicle mortargunner, \"mortar_82mm\"] call BIS_fnc_fire; // mortargunner fires mortar\n```","code":["[vehicle mortargunner, \"mortar_82mm\"] call BIS_fnc_fire; // mortargunner fires mortar"]}],"multiplayer":"The function is global, it is not to be used in unit fields.","problems":"unit will not fire its weapon from FFV position. This is due to forceWeaponFire command ignoring units in FFV.","aliases":[],"see_also":["fire","fireAtTarget","forceWeaponFire"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Combat","Function Group: Object Manipulation","Function Group: Weapons","Functions","Functions: Global Effect","Introduced with Arma 3 version 1.74"],"docblock":null,"filled_from_docblock":[]}