currentWeaponMode: 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") |
m (→Result specification: Results can be more than specified and is tied to the classname listed in CfgWeapon's mode array) |
||
Line 12: | Line 12: | ||
|gr1= Weapons | |gr1= Weapons | ||
|descr= Returns current weapon mode of unit's weapon. | |descr= Returns current weapon mode of unit's weapon. | ||
{{Feature|Warning|This command will return 0 [[Number]] if given object is a vehicle instead of a person.<br> | {{Feature|Warning|This command will return 0 [[Number]] if given object is a vehicle instead of a person.<br> | ||
Line 21: | Line 21: | ||
|p1= gunner: [[Object]] | |p1= gunner: [[Object]] | ||
|r1= [[String]] | |r1= [[String]] - current mode's classname | ||
|x1= <sqf>_weaponMode = currentWeaponMode player;</sqf> | |x1= <sqf>_weaponMode = currentWeaponMode player;</sqf> |
Revision as of 04:04, 13 January 2024
Description
- Description:
- Returns current weapon mode of unit's weapon.
- Groups:
- Weapons
Syntax
- Syntax:
- currentWeaponMode gunner
- Parameters:
- gunner: Object
- Return Value:
- String - current mode's classname
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- SWITCHWEAPON currentWeapon
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 2014-09-27 - 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.
- Posted on Jul 04, 2022 - 12:48 (UTC)
- To set the firemode of the current weapon of a player, simply use the workaround described by Killzone_Kid in the first note of the forceWeaponFire wiki entry: