throwables: Difference between revisions

From Bohemia Interactive Community
mNo edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 14: Line 14:
|p1= unit: [[Object]]
|p1= unit: [[Object]]


|r1= [[Array]] - array of throwables in format [<nowiki>[</nowiki>magazineName, muzzleName, id, ammoCount], ...], where:
|r1= [[Array]] of [[Array]]s with [magazineName, muzzleName, id, ammoCount]
* magazineName: [[String]]
* magazineName: [[String]]
* muzzleName: [[String]]
* muzzleName: [[String]]
* id: [[Array]] of [[Number]] pairs: [itemWorldID, creatorID]
* id: [[Array]] with [itemWorldID, creatorID]
** itemWorldID: [[Number]] - unique ID of the item in the world
** creatorID: [[Number]] - unique ID of the player who created the item
* ammoCount: [[Number]] magazine ammo (Since Arma 3 2.22)
* ammoCount: [[Number]] magazine ammo (Since Arma 3 2.22)


Line 26: Line 28:
|p22= includeEmpty: [[Boolean]] - (Optional, default: [[false]]) when [[true]] returns empty throwables as well.
|p22= includeEmpty: [[Boolean]] - (Optional, default: [[false]]) when [[true]] returns empty throwables as well.


|r2= [[Array]] - array of throwables in format [<nowiki>[</nowiki>magazineName, muzzleName, id, ammoCount], ...], where:
|r2= [[Array]] of [[Array]]s with [magazineName, muzzleName, id, ammoCount]
* magazineName: [[String]]
* magazineName: [[String]]
* muzzleName: [[String]]
* muzzleName: [[String]]
* id: [[Array]] of [[Number]] pairs: [itemWorldID, creatorID]
* id: [[Array]] with [itemWorldID, creatorID]
* ammoCount: [[Number]] magazine ammo
** itemWorldID: [[Number]] - unique ID of the item in the world
** creatorID: [[Number]] - unique ID of the player who created the item
* ammoCount: [[Number]] magazine ammo (Since Arma 3 2.22)


|x1= <sqf>
|x1= <sqf>

Latest revision as of 10:02, 2 January 2026

Hover & click on the images for description

Description

Description:
Returns all throwables in unit inventory in currentThrowable format.
Groups:
WeaponsUnit Inventory

Syntax

Syntax:
throwables unit
Parameters:
unit: Object
Return Value:
Array of Arrays with [magazineName, muzzleName, id, ammoCount]
  • magazineName: String
  • muzzleName: String
  • id: Array with [itemWorldID, creatorID]
    • itemWorldID: Number - unique ID of the item in the world
    • creatorID: Number - unique ID of the player who created the item
  • ammoCount: Number magazine ammo (Since Arma 3 2.22)

Alternative Syntax

Syntax:
throwables [unit, includeEmpty]
Parameters:
unit: Object
includeEmpty: Boolean - (Optional, default: false) when true returns empty throwables as well.
Return Value:
Array of Arrays with [magazineName, muzzleName, id, ammoCount]
  • magazineName: String
  • muzzleName: String
  • id: Array with [itemWorldID, creatorID]
    • itemWorldID: Number - unique ID of the item in the world
    • creatorID: Number - unique ID of the player who created the item
  • ammoCount: Number magazine ammo (Since Arma 3 2.22)

Examples

Example 1:
throwables player; /* [ ["HandGrenade","HandGrenadeMuzzle",[1e+007,0],1], ["SmokeShell","SmokeShellMuzzle",[1e+007,0],1], ["SmokeShellGreen","SmokeShellGreenMuzzle",[1e+007,0],1], ["Chemlight_green","ChemlightGreenMuzzle",[1e+007,0],1], ["Chemlight_green","",[1e+007,0],1], ["HandGrenade","",[1e+007,0],1] ] */

Additional Information

See also:
selectThrowable currentThrowable isThrowable selectWeapon currentWeapon currentMagazine currentMuzzle BIS_fnc_isThrowable

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note