weaponState: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
Killzone Kid (talk | contribs) No edit summary |
||
Line 22: | Line 22: | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
|r1=[[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount], where: | |r1=[[Array]] - in format [weapon, muzzle, firemode, magazine, ammoCount, reloadPhase], where: | ||
* weapon: [[String]] | * weapon: [[String]] | ||
* muzzle: [[String]] | * muzzle: [[String]] | ||
Line 28: | Line 28: | ||
* magazine: [[String]] | * magazine: [[String]] | ||
* ammoCount: [[Number]] | * ammoCount: [[Number]] | ||
* reloadPhase: [[Number]] - [[weaponReloadingTime]] (Since Arma 3 v2.05.147785) | |||
|s2= [[weaponState]] [vehicle, turretPath, weapon] | |s2= [[weaponState]] [vehicle, turretPath, weapon] | ||
Line 39: | Line 40: | ||
|p24= weapon (Optional): [[String]] (since Arma 3 v1.70) - 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, reloadPhase], where: | ||
* weapon: [[String]] | * weapon: [[String]] | ||
* muzzle: [[String]] | * muzzle: [[String]] | ||
Line 45: | Line 46: | ||
* magazine: [[String]] | * magazine: [[String]] | ||
* ammoCount: [[Number]] | * ammoCount: [[Number]] | ||
* reloadPhase: [[Number]] - [[weaponReloadingTime]] (Since Arma 3 v2.05.147785) | |||
|x1= <code>_wsPlayer = [[weaponState]] [[player]]; {{cc|["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]}}</code> | |x1= <code>_wsPlayer = [[weaponState]] [[player]]; {{cc|["arifle_MXC_ACO_F","arifle_MXC_ACO_F","Single","30Rnd_65x39_caseless_mag",30]}}</code> |
Revision as of 07:35, 22 June 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, reloadPhase], where:
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, reloadPhase], 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