weaponsItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<dd class="note">([^}]*)<code>([^<]*)<\/code>" to "<dd class="note">$1<sqf>$2</sqf>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 20: | Line 20: | ||
|r1= [[Array]] - array containing arrays of weapon items info in format {{hl|<nowiki>[</nowiki>weapon:[[String]], muzzle:[[String]], flashlight:[[String]], optics:[[String]], primaryMuzzleMagazine:[[Array]], secondaryMuzzleMagazine:[[Array]], bipod:[[String]]]}}, for example: {{hl|["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]}} | |r1= [[Array]] - array containing arrays of weapon items info in format {{hl|<nowiki>[</nowiki>weapon:[[String]], muzzle:[[String]], flashlight:[[String]], optics:[[String]], primaryMuzzleMagazine:[[Array]], secondaryMuzzleMagazine:[[Array]], bipod:[[String]]]}}, for example: {{hl|["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]}} | ||
|x1= <sqf>hint str weaponsItems player; | |x1= <sqf>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"], | ["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],[],""] | ||
]</ | ] | ||
*/ | |||
</sqf> | |||
|x2= <sqf>hint str weaponsItems vehicle player; | |x2= <sqf> | ||
hint str weaponsItems vehicle player; | |||
// returns e.g | |||
/* | |||
[ | |||
["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],[],""] | ||
]</ | ] | ||
*/ | |||
</sqf> | |||
|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]] | ||
Line 46: | Line 54: | ||
Be careful with this function. The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array. Therefore, do not assume the first one is always the primary weapon, and so on. | Be careful with this function. The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array. Therefore, do not assume the first one is always the primary weapon, and so on. | ||
Also, here's how the primary weapon looks if it has a grenade launcher with a loaded grenade: | Also, here's how the primary weapon looks if it has a grenade launcher with a loaded grenade: | ||
< | <sqf> | ||
[ | |||
"arifle_MX_GL_F", | "arifle_MX_GL_F", | ||
"muzzle_snds_H", | "muzzle_snds_H", | ||
Line 62: | Line 70: | ||
], | ], | ||
"" | "" | ||
]</sqf> | ] | ||
</sqf> | |||
</dl> | </dl> |
Revision as of 11:51, 14 May 2022
Description
- Description:
- Returns an array with subarrays contains class names and also names of connected items of all the vehicle's weapons.
- Since Arma 3 v1.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.
- Since Arma 3 v1.96 the returned array always contains secondary muzzle magazine info and consistent with getUnitLoadout format for weapon items.
- Since Arma 3 v2.02 the returned array can contains binocular weapon items.
- Groups:
- Unit InventoryVehicle Inventory
Syntax
- Syntax:
- weaponsItems vehicle
- Parameters:
- vehicle: Object - unit or vehicle
- Return Value:
- Array - array containing arrays of weapon items info in format [weapon:String, muzzle:String, flashlight:String, optics:String, primaryMuzzleMagazine:Array, secondaryMuzzleMagazine:Array, bipod:String], for example: ["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]
Examples
- Example 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
- Posted on August 17, 2013
- AgentRev
-
Be careful with this function. The weapons are listed in the order they were taken by the unit, with the most recent at the bottom of the array. Therefore, do not assume the first one is always the primary weapon, and so on.
Also, here's how the primary weapon looks if it has a grenade launcher with a loaded grenade:
[ "arifle_MX_GL_F", "muzzle_snds_H", "acc_pointer_IR", "optic_Aco", [ "30Rnd_65x39_caseless_mag", 30 ], [ "1Rnd_HE_Grenade_shell", 1 ], "" ]