weaponsItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ">Posted on August ([0-9]{2}), ([0-9]{4})" to ">Posted on $2-08-$1") |
Lou Montana (talk | contribs) m (Text replacement - "↵↵+<\/sqf>" to " </sqf>") |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 8: | Line 8: | ||
|gr2= Vehicle Inventory | |gr2= Vehicle Inventory | ||
|descr= [[ | |descr= [[File:Weaponsitems.jpg|150px|right|border]]Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons. | ||
{{Feature | | {{Feature|informative|This command can return weapon magazine(s) if any are present. Or an empty array if weapon is stored without a magazine in it.}} | ||
* | * {{GVI|arma3|1.22|size= 0.75}} it is possible to query weapon holders and ammo crates with this command.<br><!-- | ||
* | -->If the argument is a vehicle, the command will return vehicle's weapons.<br><!-- | ||
* | -->If the argument is a container, the command will act identical to [[weaponsItemsCargo]]. | ||
* {{GVI|arma3|1.96|size= 0.75}} the returned array always contains secondary muzzle magazine info and consistent with [[getUnitLoadout]] format for weapon items. | |||
* {{GVI|arma3|2.02|size= 0.75}} the returned array can contains binocular weapon items. | |||
|s1= [[weaponsItems]] vehicle | |s1= [[weaponsItems]] vehicle | ||
Line 18: | Line 20: | ||
|p1= vehicle: [[Object]] - unit or vehicle | |p1= vehicle: [[Object]] - unit or vehicle | ||
|r1= [[Array]] | |r1= [[Array]] of [[Array]]s of weapon items, format [weapon, muzzle, flashlight, optics, [magazine, ammo], [magazine, ammo], bipod]: | ||
* weapon: [[String]] | |||
* muzzle: [[String]] | |||
* flashlight: [[String]] | |||
* optics: [[String]] | |||
* [primaryMagazine, primaryAmmo]: [[Array]] - could be empty | |||
* [secondaryMagazine, secondaryAmmo]: [[Array]] - could be empty | |||
* bipod: [[String]] | |||
{{Feature|important|The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array, e.g do '''not''' assume the first item is always the primary weapon.}} | |||
|x1= <sqf>hint str weaponsItems player; | |s2= [[weaponsItems]] [vehicle, extended] | ||
|s2since= arma3 2.14 | |||
|p21= vehicle: [[Object]] - unit or vehicle | |||
|p22= extended: [[Boolean]] - [[true]] to include muzzle information | |||
|r2= [[Array]] of [[Array]]s (see above) in format [weapon, muzzle, flashlight, optics, [magazine, ammo, muzzle, maxammo], [magazine, ammo, muzzle, maxammo], bipod] | |||
|x1= <sqf> | |||
hint str weaponsItems player; | |||
// returns e.g | // returns e.g | ||
/* | /* | ||
[ | [ | ||
["arifle_MX_ACO_pointer_F","muzzle_snds_H","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],[],"bipod_01_F_blk"], | ["arifle_MX_ACO_pointer_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], [], "bipod_01_F_blk"], | ||
["launch_NLAW_F","","","",["NLAW_F",1],[],""], | ["launch_NLAW_F", "", "", "", ["NLAW_F", 1], [], ""], | ||
["hgun_P07_F","muzzle_snds_L","","",["16Rnd_9x21_Mag",11],[],""] | ["hgun_P07_F", "muzzle_snds_L", "", "", ["16Rnd_9x21_Mag", 11], [], ""] | ||
] | |||
// a loaded underbarrel grenade launcher can look like this: | |||
[ | |||
["arifle_MX_GL_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], ["1Rnd_HE_Grenade_shell", 1], ""] | |||
] | ] | ||
*/ | */ | ||
Line 36: | Line 59: | ||
/* | /* | ||
[ | [ | ||
["gatling_30mm","","","",["250Rnd_30mm_HE_shells",250],[],""], | ["gatling_30mm", "", "", "", ["250Rnd_30mm_HE_shells", 250], [], ""], | ||
["missiles_SCALPEL","","","",["8Rnd_LG_scalpel",8],[],""], | ["missiles_SCALPEL", "", "", "", ["8Rnd_LG_scalpel", 8], [], ""], | ||
["rockets_Skyfire","","","",["38Rnd_80mm_rockets",38],[],""] | ["rockets_Skyfire", "", "", "", ["38Rnd_80mm_rockets", 38], [], ""] | ||
] | ] | ||
*/ | */ | ||
Line 45: | Line 68: | ||
|seealso= [[weaponsItemsCargo]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[handgunItems]] [[addPrimaryWeaponItem]] [[addSecondaryWeaponItem]] [[addHandgunItem]] [[primaryWeapon]] [[secondaryWeapon]] [[handgunWeapon]] [[binocular]] [[weaponAccessories]] [[addWeaponWithAttachmentsCargoGlobal]] [[BIS_fnc_weaponComponents]] [[weaponState]] | |seealso= [[weaponsItemsCargo]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[handgunItems]] [[addPrimaryWeaponItem]] [[addSecondaryWeaponItem]] [[addHandgunItem]] [[primaryWeapon]] [[secondaryWeapon]] [[handgunWeapon]] [[binocular]] [[weaponAccessories]] [[addWeaponWithAttachmentsCargoGlobal]] [[BIS_fnc_weaponComponents]] [[weaponState]] | ||
}} | }} | ||
Latest revision as of 11:35, 3 September 2024
Description
- Description:
- Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons.
- 1.22 it is possible to query weapon holders and ammo crates with this command.
If the argument is a vehicle, the command will return vehicle's weapons.
If the argument is a container, the command will act identical to weaponsItemsCargo. - 1.96 the returned array always contains secondary muzzle magazine info and consistent with getUnitLoadout format for weapon items.
- 2.02 the returned array can contains binocular weapon items.
- 1.22 it is possible to query weapon holders and ammo crates with this command.
- Groups:
- Unit InventoryVehicle Inventory
Syntax
- Syntax:
- weaponsItems vehicle
- Parameters:
- vehicle: Object - unit or vehicle
- Return Value:
- Array of Arrays of weapon items, format [weapon, muzzle, flashlight, optics, [magazine, ammo], [magazine, ammo], bipod]:
Alternative Syntax
- Syntax:
- weaponsItems [vehicle, extended]
- Parameters:
- vehicle: Object - unit or vehicle
- extended: Boolean - true to include muzzle information
- Return Value:
- Array of Arrays (see above) in format [weapon, muzzle, flashlight, optics, [magazine, ammo, muzzle, maxammo], [magazine, ammo, muzzle, maxammo], bipod]
Examples
- Example 1:
- hint str weaponsItems player; // returns e.g /* [ ["arifle_MX_ACO_pointer_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], [], "bipod_01_F_blk"], ["launch_NLAW_F", "", "", "", ["NLAW_F", 1], [], ""], ["hgun_P07_F", "muzzle_snds_L", "", "", ["16Rnd_9x21_Mag", 11], [], ""] ] // a loaded underbarrel grenade launcher can look like this: [ ["arifle_MX_GL_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", ["30Rnd_65x39_caseless_mag", 30], ["1Rnd_HE_Grenade_shell", 1], ""] ] */
- Example 2:
Additional Information
- See also:
- weaponsItemsCargo primaryWeaponItems secondaryWeaponItems handgunItems addPrimaryWeaponItem addSecondaryWeaponItem addHandgunItem primaryWeapon secondaryWeapon handgunWeapon binocular weaponAccessories addWeaponWithAttachmentsCargoGlobal BIS_fnc_weaponComponents weaponState
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