forceWeaponFire: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(example, locality)
Line 5: Line 5:


|0.50|= Game version
|0.50|= Game version
|arg= local |= Arguments in MP
|eff= global |= Effects in MP
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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.  
| 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]]. |= Description
 
Note: This command has strange locality. Executed on remote unit it will change the firemode but will not make unit fire. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 26: Line 28:


|x1= <code>soldierOne [[forceWeaponFire]] ["arifle_MX_F", "Single"];</code>|= EXAMPLE1  
|x1= <code>soldierOne [[forceWeaponFire]] ["arifle_MX_F", "Single"];</code>|= EXAMPLE1  
 
|x2= <code>_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"];</code>|= EXAMPLE1
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[currentWeapon]], [[currentWeaponMode]] |= SEEALSO  
| [[currentWeapon]], [[currentWeaponMode]], [[fire]], [[setWeaponReloadingTime]], [[selectWeapon]] |= SEEALSO  


|  |= MPBEHAVIOUR  
|  |= MPBEHAVIOUR  

Revision as of 16:31, 22 February 2014

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 - Possible options are "Single", "Burst" and "FullAuto".
Return Value:
Nothing

Examples

Example 1:
soldierOne forceWeaponFire ["arifle_MX_F", "Single"];
Example 2:
_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:
currentWeaponcurrentWeaponModefiresetWeaponReloadingTimeselectWeapon

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];

Bottom Section