weaponState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
m (Text replacement - "v1\.69\.[0-9]{6}" to "v1.70")
Line 9: Line 9:
| Returns the currently selected weapon state for unit or vehicle.<br><br>
| Returns the currently selected weapon state for unit or vehicle.<br><br>
{{Feature|arma3 |
{{Feature|arma3 |
Since {{arma3}} v1.69.140397 this command has been improved and extended:
Since {{arma3}} v1.70 this command has been improved and extended:
* A vehicle's weapon query doesn't need a weapon operator provided the weapon or muzzle is specified in optional param.<br>(keep in mind that by default a vehicle has no weapons selected)
* A vehicle's weapon query doesn't need a weapon operator provided the weapon or muzzle is specified in optional param.<br>(keep in mind that by default a vehicle has no weapons selected)
* Driver turret can now be accessed as well with turret path [-1].
* Driver turret can now be accessed as well with turret path [-1].
Line 33: Line 33:
|p23= turretPath: [[Array]]
|p23= turretPath: [[Array]]


|p24= weapon (Optional): [[String]] (since Arma 3 v1.69.140397) - weapon or muzzle name
|p24= weapon (Optional): [[String]] (since Arma 3 v1.70) - weapon or muzzle name


|r2= [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
|r2= [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where:

Revision as of 10:22, 3 April 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Weapons

Syntax

Syntax:
Syntax needed
Parameters:
unit: Object
Return Value:
Return value needed

Alternative Syntax

Syntax:
weaponState [vehicle, turretPath, weapon]
Parameters:
[vehicle, turretPath, weapon]: Array
vehicle: Object
turretPath: Array
weapon (Optional): String (since Arma 3 v1.70) - 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

See also:
weaponsselectWeaponTurretloadMagazinemagazinesTurretweaponsTurret

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