weaponState: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (see also) |
Killzone Kid (talk | contribs) (format) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns the current weapon state | | Returns the current unit's or vehicle's weapon state |= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| '''weaponState''' | | '''weaponState''' unit |= Syntax | ||
|p1= | |p1= unit: [[Object]] |= Parameter 1 | ||
| [[Array]] - [ | | [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where: | ||
* weapon: [[String]] | |||
* muzzle: [[String]] | |||
* firemode: [[String]] | |||
* magazine: [[String]] | |||
* ammoCount: [[Number]] |= Return value | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|s2= '''weaponState''' [vehicle, turretPath] |= Syntax | |s2= '''weaponState''' [vehicle, turretPath] |= Syntax | ||
|p21= vehicle: [[Object]] |= Parameter 1 | |p21 = [vehicle, turretPath]: [[Array]] |= | ||
|p22= vehicle: [[Object]] |= Parameter 1 | |||
| | |p23= turretPath: [[Array]] |= Parameter 2 | ||
|r2= [[Array]] - [ | |r2= [[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where: | ||
* weapon: [[String]] | |||
* muzzle: [[String]] | |||
* firemode: [[String]] | |||
* magazine: [[String]] | |||
* ammoCount: [[Number]] |= Return value | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code> | |x1= <code>_wsPlayer <nowiki>=</nowiki> [[weaponState]] [[player]];// ["m16a4","m16a4","Single","30Rnd_556x45_Stanag",29]</code>|= EXAMPLE1 | ||
|x2= <code> | |x2= <code>_wsVehiclePlayer <nowiki>=</nowiki> [[weaponState]] <nowiki>[</nowiki>[[vehicle]] [[player]],[0]]; //["M256","M256","M256","20Rnd_120mmSABOT_M1A2",20] </code>|= EXAMPLE2 | ||
|x3= <code>_SecondPositionOfThefirstTurret <nowiki>=</nowiki> [[weaponState]] [ [[vehicle]] [[player]],[0,0,1]];</code>|= EXAMPLE2 | |x3= <code>_SecondPositionOfThefirstTurret <nowiki>=</nowiki> [[weaponState]] <nowiki>[</nowiki>[[vehicle]] [[player]],[0,0,1]]; </code>|= EXAMPLE2 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ |
Revision as of 14:55, 13 February 2017
Description
- Description:
- Returns the current unit's or vehicle's weapon state
- Groups:
- Uncategorised
Syntax
- Syntax:
- weaponState unit
- Parameters:
- unit: Object
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Alternative Syntax
- Syntax:
- weaponState [vehicle, turretPath]
- Parameters:
- [vehicle, turretPath]: Array
- vehicle: Object
- turretPath: Array
- Return Value:
- Array - in format [weapon, muzzle, firemode, magazine, ammoCount], where:
Examples
- Example 1:
_wsPlayer = weaponState player;// ["m16a4","m16a4","Single","30Rnd_556x45_Stanag",29]
- Example 2:
_wsVehiclePlayer = weaponState [vehicle player,[0]]; //["M256","M256","M256","20Rnd_120mmSABOT_M1A2",20]
- Example 3:
_SecondPositionOfThefirstTurret = weaponState [vehicle player,[0,0,1]];
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
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
Categories:
- Scripting Commands
- Introduced with Arma 2: Operation Arrowhead version 1.60
- Arma 2: Operation Arrowhead: New Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands ArmA2
- Scripting Commands Arma 3
- Scripting Commands Take On Helicopters
- ArmA 2 OA: New Scripting Commands List