weaponsItemsCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Undo revision 91411 by Benargee (talk)My mistake.)
No edit summary
 
(54 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 1.22


|1.22|= Game version
|gr1= Containers


____________________________________________________________________________________________
|gr2= Vehicle Inventory


|Returns an array with subarrays contains class names and also names of connected items of all the vehicle's cargo weapons like <nowiki>[[</nowiki>'arifle_MX_ACO_pointer_F',<nowiki>''</nowiki>,'acc_pointer_IR','optic_Aco',['30Rnd_65x39_caseless_mag',29<nowiki>]</nowiki>,'bipod_01_F_blk'<nowiki>]]</nowiki>. |= Description
|descr=Returns an array with subarrays contains class names and also names of connected items of all the vehicle's cargo weapons in [[weaponsItems]] format. If weapon has no magazine, an empty array [] is returned instead of magazine info. If the argument is a vehicle with weapons, vehicles cargo is searched, unlike with [[weaponsItems]] command, which will return vehicle's weapons instead.
____________________________________________________________________________________________
* Since Arma 3 v1.96 the returned array always contains secondary muzzle magazine info and consistent with [[getUnitLoadout]] format for weapon items.


| '''weaponsItemsCargo''' vehicle |= Syntax
|s1= [[weaponsItemsCargo]] vehicle


|p1= vehicle: [[Object]] |= Parameter 1
|p1= vehicle: [[Object]] ammobox or vehicle


| [[Array]] |= Return value
|r1= [[Array]] - see [[weaponsItems]]
____________________________________________________________________________________________
 
|x1= <code>[[weaponsItemsCargo]] [[vehicle]] [[player]];</code> |= Example 1


|x2= <code>[[weaponsItemsCargo]] _weaponholder;</code> |= Example 2
|s2= [[weaponsItemsCargo]] [vehicle, extended]
____________________________________________________________________________________________
|s2since= arma3 2.14


| [[weaponsItems]] |= See also
|p21= vehicle: [[Object]] - ammobox or vehicle
|p22= extended: [[Boolean]] - [[true]] to include muzzle information


}}
|r2= [[Array]] - see [[weaponsItems]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>weaponsItemsCargo vehicle player;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x2= <sqf>weaponsItemsCargo _weaponholder;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[weaponsItems]] [[primaryWeaponItems]] [[secondaryWeaponItems]] [[handgunItems]] [[addPrimaryWeaponItem]] [[addSecondaryWeaponItem]] [[addHandgunItem]] [[primaryWeapon]] [[secondaryWeapon]] [[handgunWeapon]] [[weaponAccessories]] [[weaponAccessoriesCargo]] [[addWeaponWithAttachmentsCargoGlobal]]
 
}}
 
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on March 16, 2015 - 12:13 (UTC)</dd>
<dt class="note">[[User:Jezuro|Jezuro]]</dt>
<dd class="note">
Since revision 129742, this command also returns an attached bipod.
</dd>
</dl>
<!-- DISCONTINUE Notes -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on August 21, 2015 - 10:42 (UTC)</dd>
<dt class="note">[[User:IT07|IT07]]</dt>
<dd class="note">
(ArmA 1.50) This command is sort-of bugged: if no magazine is present in the gun, it will not be available at all in the ARRAY. I expect it to be an empty STRING instead. Example <br>
<code>["weapon_className","silencer","laser/light","scope",["magClassName",30],""] // With mag in gun</code>
<code>["weapon_className","silencer","laser/light","scope",""] // Without mag in gun</code>
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 19:55, 21 July 2023

Hover & click on the images for description

Description

Description:
Returns an array with subarrays contains class names and also names of connected items of all the vehicle's cargo weapons in weaponsItems format. If weapon has no magazine, an empty array [] is returned instead of magazine info. If the argument is a vehicle with weapons, vehicles cargo is searched, unlike with weaponsItems command, which will return vehicle's weapons instead.
  • Since Arma 3 v1.96 the returned array always contains secondary muzzle magazine info and consistent with getUnitLoadout format for weapon items.
Groups:
ContainersVehicle Inventory

Syntax

Syntax:
weaponsItemsCargo vehicle
Parameters:
vehicle: Object ammobox or vehicle
Return Value:
Array - see weaponsItems

Alternative Syntax

Syntax:
weaponsItemsCargo [vehicle, extended]
Parameters:
vehicle: Object - ammobox or vehicle
extended: Boolean - true to include muzzle information
Return Value:
Array - see weaponsItems

Examples

Example 1:
weaponsItemsCargo vehicle player;
Example 2:
weaponsItemsCargo _weaponholder;

Additional Information

See also:
weaponsItems primaryWeaponItems secondaryWeaponItems handgunItems addPrimaryWeaponItem addSecondaryWeaponItem addHandgunItem primaryWeapon secondaryWeapon handgunWeapon weaponAccessories weaponAccessoriesCargo addWeaponWithAttachmentsCargoGlobal

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