forceWeaponFire: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Wrong type os parameter fixed.)
No edit summary
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


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


| unit '''forceWeaponFire''' [weapon, mode] |= Syntax
| unit '''forceWeaponFire''' [weapon, firemode] |= Syntax


|p1= unit: [[Object]]  |= PARAMETER1  
|p1= unit: [[Object]]  |= PARAMETER1  
Line 18: Line 20:
|p3= weapon: [[String]]  |= PARAMETER3
|p3= weapon: [[String]]  |= PARAMETER3


|p4= mode: [[String]] - Possible options are "Single", "Burst" and "FullAuto". |= PARAMETER4
|p4= firemode: [[String]] - Possible options are "Single", "Burst" and "FullAuto". |= PARAMETER4


| [[Nothing]] |= RETURNVALUE  
| [[Nothing]] |= RETURNVALUE  




|x1= <code>soldierOne forceWeaponFire [&quot;arifle_MX_F&quot;, "Single"]</code>|= EXAMPLE1  
|x1= <code>soldierOne [[forceWeaponFire]] ["arifle_MX_F", "Single"];</code>|= EXAMPLE1  


____________________________________________________________________________________________
____________________________________________________________________________________________


| |= SEEALSO  
| [[currentWeapon]], [[currentWeaponMode]] |= SEEALSO  


|  |= MPBEHAVIOUR  
|  |= MPBEHAVIOUR  
Line 36: Line 38:
<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
 
<dd class="notedate">Posted on August 25, 2013
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
<dd class="note">Here is a neat workaround trick for firemode change from a script:
<code>_weapon = [[currentWeapon]] [[player]];
_ammo = [[player]] [[ammo]] _weapon;
[[player]] [[setAmmo]] [_weapon, 0];
[[player]] [[forceWeaponFire]] [_weapon, "FullAuto"];
[[player]] [[setAmmo]] [_weapon, _ammo];</code>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 11:51, 25 August 2013

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

Syntax

Syntax:
unit forceWeaponFire [weapon, firemode]
Parameters:
unit: Object
[weapon, mode]: Array
weapon: String
firemode: String - Possible options are "Single", "Burst" and "FullAuto".
Return Value:
Nothing

Examples

Example 1:
soldierOne forceWeaponFire ["arifle_MX_F", "Single"];

Additional Information

See also:
currentWeaponcurrentWeaponMode

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