forceWeaponFire

From Bohemia Interactive Community
Revision as of 01:51, 3 September 2014 by Ffur2007slx2 5 (talk | contribs) (note format)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
The unit will be forced to fire from the given weapon. The weapon will not fire if firemode passed as parameter is not supported by the weapon. Command must be executed where unit is local.
Groups:
Uncategorised

Syntax

Syntax:
unit forceWeaponFire [weapon, firemode]
Parameters:
unit: Object
[weapon, firemode]: Array
weapon: String
firemode: String - Common options are "Single", "Burst", "FullAuto". For the full list of a weapon firemodes: hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes")); If modes[] param in config for the weapon says {"this"}, then the same classname as for the weapon param should be used as firemode param.
Return Value:
Nothing

Examples

Example 1:
soldierOne forceWeaponFire ["arifle_MX_F", "Single"];
Example 2:
player forceWeaponFire ["hgun_ACPC2_F", "hgun_ACPC2_F"];
Example 3:
_unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"]; _unit forceWeaponFire ["MiniGrenadeMuzzle","MiniGrenadeMuzzle"]; _unit forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"]; _unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"]; _unit forceWeaponFire ["ChemlightGreenMuzzle","ChemlightGreenMuzzle"]; _unit forceWeaponFire ["IRGrenade","IRGrenade"];

Additional Information

See also:
currentWeaponcurrentWeaponModefiresetWeaponReloadingTimeselectWeapondoFirecommandFirefireAtTarget

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on August 25, 2013
Killzone_Kid
Here is a neat workaround trick for firemode change from a script: _weapon = currentWeapon player; _ammo = player ammo _weapon; player setAmmo [_weapon, 0]; player forceWeaponFire [_weapon, "FullAuto"]; player setAmmo [_weapon, _ammo];
Posted on April 14, 2014
ffur2007slx2_5
(A3 1.16) forceWeaponFire is no longer only limited to units, but can remote aircrafts weapon firing as well. Passed source unit should be the correct one who controls the weapon, if passed mode is "this", use the weapon name instead: _weapon = (weapons _veh) select 3; _mode = (getArray (configFile >> "cfgweapons" >> _weapon >> "modes")) select 0; if (_mode == "this") then {_mode = _weapon;}; (driver _veh) forceWeaponFire [_weapon, _mode]; //Force a CAS fire a rocket. Currently this command is not available for land vehicle remote fire.
Posted on September 02, 2014
Benargee
Similar to Killzone Kid's note, This fires the units current weapon in its current firemode. _unit forceWeaponFire [ weaponState _unit select 1, weaponState _unit select 2];

Bottom Section