weaponState: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Take[ _]On[ _]Helicopters(\|.*)?\]\]" to "{{GameCategory|tkoh|Scripting Commands}}") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Command|Comments= | {{Command|Comments= | ||
| arma2oa |Game name= | | arma2oa |Game name= | ||
Line 7: | Line 6: | ||
|gr1= Weapons |GROUP1= | |gr1= Weapons |GROUP1= | ||
| Returns the currently selected weapon state for unit or vehicle.<br><br> | | Returns the currently selected weapon state for unit or vehicle.<br><br> | ||
Line 15: | Line 13: | ||
* Driver turret can now be accessed as well with turret path [-1]. | * Driver turret can now be accessed as well with turret path [-1]. | ||
* Muzzle name is supported as well as weapon name. The command searches for weapon first, then if not found, muzzle is searched for. }}|DESCRIPTION= | * Muzzle name is supported as well as weapon name. The command searches for weapon first, then if not found, muzzle is searched for. }}|DESCRIPTION= | ||
| [[weaponState]] unit |SYNTAX= | | [[weaponState]] unit |SYNTAX= | ||
Line 27: | Line 24: | ||
* magazine: [[String]] | * magazine: [[String]] | ||
* ammoCount: [[Number]] |RETURNVALUE= | * ammoCount: [[Number]] |RETURNVALUE= | ||
|s2= [[weaponState]] [vehicle, turretPath, weapon] |SYNTAX2= | |s2= [[weaponState]] [vehicle, turretPath, weapon] |SYNTAX2= | ||
Line 45: | Line 41: | ||
* magazine: [[String]] | * magazine: [[String]] | ||
* ammoCount: [[Number]] |RETURNVALUE2= | * ammoCount: [[Number]] |RETURNVALUE2= | ||
|x1= <code>_wsPlayer = [[weaponState]] [[player]]; {{cc|["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]}}</code> |EXAMPLE1= | |x1= <code>_wsPlayer = [[weaponState]] [[player]]; {{cc|["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]}}</code> |EXAMPLE1= | ||
|x2= <code>_wsVehicle = [[weaponState]] [_apc, [0]]; {{cc|["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]}}</code> |EXAMPLE2= | |x2= <code>_wsVehicle = [[weaponState]] [_apc, [0]]; {{cc|["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]}}</code> |EXAMPLE2= | ||
|x3= <code>_wsVehicle = [[weaponState]] [_apc, [0], "AP"]; {{cc|["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]}}</code> |EXAMPLE3= | |x3= <code>_wsVehicle = [[weaponState]] [_apc, [0], "AP"]; {{cc|["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]}}</code> |EXAMPLE3= | ||
| [[weapons]], [[selectWeaponTurret]], [[loadMagazine]], [[magazinesTurret]], [[weaponsTurret]] |SEEALSO= | | [[weapons]], [[selectWeaponTurret]], [[loadMagazine]], [[magazinesTurret]], [[weaponsTurret]] |SEEALSO= |
Revision as of 04:22, 17 January 2021
Description
- Description:
- Returns the currently selected weapon state for unit or vehicle.
- Groups:
- Weapons
Syntax
- Syntax:
- weaponState unit
- Parameters:
- unit: Object
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Alternative Syntax
- Syntax:
- weaponState [vehicle, turretPath, weapon]
- Parameters:
- [vehicle, turretPath, weapon]: Array
- vehicle: Object
- turretPath: Array
- weapon (Optional): String (since Arma 3 v1.69.140397) - weapon or muzzle name
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Examples
- Example 1:
_wsPlayer = weaponState player; // ["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]
- Example 2:
_wsVehicle = weaponState [_apc, [0]]; // ["autocannon_40mm_CTWS","HE","player","60Rnd_40mm_GPR_Tracer_Red_shells",60]
- Example 3:
_wsVehicle = weaponState [_apc, [0], "AP"]; // ["autocannon_40mm_CTWS","AP","player","40Rnd_40mm_APFSDS_Tracer_Red_shells",40]
Additional Information
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