weaponState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (formate)
Line 26: Line 26:
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>_weaponStatePlayer <nowiki>=</nowiki> '''weaponState''' player;</code>|= EXAMPLE1  
|x1= <code>_weaponStatePlayer <nowiki>=</nowiki> [[weaponState]] [[player]];</code>|= EXAMPLE1  
|x2= <code>_weaponStateVehiclePlayer <nowiki>=</nowiki> '''weaponState''' [vehicle player,[0]];</code>|= EXAMPLE2  
|x2= <code>_weaponStateVehiclePlayer <nowiki>=</nowiki> [[weaponState]] [ [[vehicle]] [[player]],[0]];</code>|= EXAMPLE2  


____________________________________________________________________________________________
____________________________________________________________________________________________
Line 44: Line 44:
<dd class="notedate">Posted on February 17, 2012
<dd class="notedate">Posted on February 17, 2012
<dt class="note">'''[[User:kju|kju]]'''
<dt class="note">'''[[User:kju|kju]]'''
<dd class="note">The command does not work for a vehicle driver - even if he has weapons.
<dd class="note">The command does not work for a vehicle driver - even if he has weapons.<br>
<dd class="note">The command only works for vehicle positions, if there was an unit on the position '''before'''. When a position has been occupied once, the command even works when there is no unit currently at the given vehicle position.
The command only works for vehicle positions, if there was an unit on the position '''before'''. When a position has been occupied once, the command even works when there is no unit currently at the given vehicle position.
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 02:26, 3 September 2014

Hover & click on the images for description

Description

Description:
Returns the current weapon state as an array of strings in the following format [WeaponName, MuzzleName, ModeName, MagazineName, AmmoCount] (AmmoCount is Number).
Groups:
Uncategorised

Syntax

Syntax:
weaponState unitName
Parameters:
unitName: Object
Return Value:
Array: ["m16a4","m16a4","Single","30Rnd_556x45_Stanag",29]

Alternative Syntax

Syntax:
weaponState [vehicle, turretPath]
Parameters:
vehicle: Object
turretPath: Array
Return Value:
Array: ["M256","M256","M256","20Rnd_120mmSABOT_M1A2",20]

Examples

Example 1:
_weaponStatePlayer = weaponState player;
Example 2:
_weaponStateVehiclePlayer = weaponState [ vehicle player,[0]];

Additional Information

See also:
See also needed

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 February 17, 2012
kju
The command does not work for a vehicle driver - even if he has weapons.
The command only works for vehicle positions, if there was an unit on the position before. When a position has been occupied once, the command even works when there is no unit currently at the given vehicle position.

Bottom Section