forceWeaponFire: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ">Posted on September ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-09-$1") |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^-]+) *- *C([a-eg-z])" to "$1 - c$2") |
||
Line 20: | Line 20: | ||
|p2= muzzle: [[String]] | |p2= muzzle: [[String]] | ||
|p3= firemode: [[String]] - | |p3= firemode: [[String]] - common options are "Single", "Burst", "FullAuto". For the full list of a weapon firemodes: | ||
<sqf>hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes"));</sqf> 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. | <sqf>hint str (getArray (configFile >> "CfgWeapons" >> currentWeapon player >> "modes"));</sqf> 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. |
Revision as of 14:00, 8 November 2023
Description
- 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
- Groups:
- Unit ControlWeapons
Syntax
- Syntax:
- unit forceWeaponFire [muzzle, firemode]
- Parameters:
- unit: Object - unit alone or in vehicle
- muzzle: String
- firemode: String - common options are "Single", "Burst", "FullAuto". For the full list of a weapon firemodes:
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.
- Return Value:
- Nothing
Examples
- Example 1:
- _unit forceWeaponFire ["arifle_MX_F", "Single"]; _unit forceWeaponFire ["hgun_ACPC2_F", "hgun_ACPC2_F"]; _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"]; _unit forceWeaponFire ["Laserdesignator","Laserdesignator"];
- Example 2:
Additional Information
- See also:
- currentWeapon currentWeaponMode setWeaponReloadingTime selectWeapon fire doFire commandFire canFire fireAtTarget commandArtilleryFire commandSuppressiveFire doArtilleryFire doSuppressiveFire isManualFire BIS_fnc_fire
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
- Posted on 2013-08-25
- Killzone_Kid
- Here is a neat workaround trick for firemode change from a script:
- Posted on 2014-04-14
- 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: Currently this command is not available for land vehicle remote fire.
- Posted on 2014-09-02
- Benargee
-
Similar to Killzone Kid's note, This fires the units current weapon in its current firemode.
- Posted on 2015-01-03 - 14:55 (UTC)
- Killzone Kid
-
fireAtTarget command can be used to force fire gunner weapon in vehicles. A gunner must be present. Will fire one shot even if player is gunner. fire command can also be used to fire vehicle weapon, like smoke launcher for example: And if this doesn't work, it is possible to force fire via action