weaponsItems: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " +" to " ") |
Lou Montana (talk | contribs) m (Text replacement - " \| *(\[\[[a-zA-Z0-9]+\]\][^ ]+) *\|x1=" to " |r1= $1 |x1=") |
||
Line 19: | Line 19: | ||
|p1= vehicle: [[Object]] - unit or vehicle | |p1= vehicle: [[Object]] - unit or vehicle | ||
| [[Array]] - array containing arrays of weapon items info in format <tt><nowiki>[</nowiki>weapon:[[String]], muzzle:[[String]], flashlight:[[String]], optics:[[String]], primaryMuzzleMagazine:[[Array]], secondaryMuzzleMagazine:[[Array]], bipod:[[String]]]</tt>, for example: <tt>["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]</tt> | |r1= [[Array]] - array containing arrays of weapon items info in format <tt><nowiki>[</nowiki>weapon:[[String]], muzzle:[[String]], flashlight:[[String]], optics:[[String]], primaryMuzzleMagazine:[[Array]], secondaryMuzzleMagazine:[[Array]], bipod:[[String]]]</tt>, for example: <tt>["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]</tt> | ||
|x1= <code>[[hint]] [[str]] [[weaponsItems]] [[player]];</code> | |x1= <code>[[hint]] [[str]] [[weaponsItems]] [[player]];</code> |
Revision as of 13:21, 12 June 2021
Description
- Description:
- Description needed
- Groups:
- Unit InventoryVehicle Inventory
Syntax
- Syntax:
- Syntax needed
- 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:
hint str weaponsItems player;
[ ["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],[],""] ]
- Example 2:
hint str weaponsItems vehicle player;
[ ["gatling_30mm","","","",["250Rnd_30mm_HE_shells",250],[],""], ["missiles_SCALPEL","","","",["8Rnd_LG_scalpel",8],[],""], ["rockets_Skyfire","","","",["38Rnd_80mm_rockets",38],[],""] ]
Additional Information
- See also:
- weaponsItemsCargoprimaryWeaponItemssecondaryWeaponItemshandgunItemsaddPrimaryWeaponItemaddSecondaryWeaponItemaddHandgunItemprimaryWeaponsecondaryWeaponhandgunWeaponbinocularweaponAccessoriesaddWeaponWithAttachmentsCargoGlobalBIS_fnc_weaponComponents
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 ], "" ]