currentWeaponMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (For the love of Zeus, please use proper note formatting Pierre!)
Line 27: Line 27:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
Pierre MGI - September 2014 - Be careful using this in script. This function returns these strings but also:
- 0 if unit is in a vehicle (pax),
- absolutely nothing if AH-99 helo driver or all weapons removed,
- "truckhorn2" if Hunter driver...
Absolutely nothing means: if you use a hint to display the returned value, you obtain absolutely no text,no black box, no error! Hint isn't displayed and there is no error in rpt file with compile preprocessFileLineNumbers.
On the other hand, returned value 0 when unit is pax of a vehicle, could lead to a variable error type if your script is waiting for a string.


<!-- Note Section END -->
<!-- Note Section END -->
Line 48: Line 41:
<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dl class="command_description">
<dd class="notedate">Posted on September 27, 2014 - 19:01 (UTC)</dd>
<dd class="notedate">Posted on September 27, 2014 - 18:20 (UTC)</dd>
<dt class="note">[[User:Benargee|Benargee]]</dt>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
<dd class="note">
Blank
- Be careful using this in script. This function returns these strings but also:
- 0 if unit is in a vehicle (pax),
- absolutely nothing if AH-99 helo driver or all weapons removed,
- "truckhorn2" if Hunter driver...
Absolutely nothing means: if you use a hint to display the returned value, you obtain absolutely no text,no black box, no error! Hint isn't displayed and there is no error in rpt file with compile preprocessFileLineNumbers.
 
On the other hand, returned value 0 when unit is pax of a vehicle, could lead to a variable error type if your script is waiting for a string.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 20:06, 27 September 2014

Hover & click on the images for description

Description

Description:
Returns current weapon mode of unit's weapon. Result can be: "Single", "Burst", "FullAuto", "manual", "player"
Groups:
Uncategorised

Syntax

Syntax:
currentWeaponMode gunner
Parameters:
gunner: Object
Return Value:
String

Examples

Example 1:
_weaponMode = currentWeaponMode player;
Example 2:
_weaponMode = currentWeaponMode gunner vehicle player;

Additional Information

See also:
ArmA:_Actions#SWITCHWEAPONcurrentWeapon

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

Bottom Section

Posted on September 27, 2014 - 18:20 (UTC)
Pierre MGI
- Be careful using this in script. This function returns these strings but also: - 0 if unit is in a vehicle (pax), - absolutely nothing if AH-99 helo driver or all weapons removed, - "truckhorn2" if Hunter driver... Absolutely nothing means: if you use a hint to display the returned value, you obtain absolutely no text,no black box, no error! Hint isn't displayed and there is no error in rpt file with compile preprocessFileLineNumbers. On the other hand, returned value 0 when unit is pax of a vehicle, could lead to a variable error type if your script is waiting for a string.