unitAddons: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[cC]ommand[_ ][gG]roup:[_ ][^|]+\|\{*uc:{{PAGENAME}*]\]" to "")
m (Some wiki formatting)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Mods and Addons


|gr1= Mods and Addons |GROUP1=
|descr= Returns list with addons the unit belongs to.


| Returns list with addons the unit belongs to. |DESCRIPTION=
|s1= [[unitAddons]] className


| [[unitAddons]] className  |SYNTAX=
|p1= className: [[String]] - class name of a unit/vehicle or object


|p1= className: [[String]] - class name of a unit/vehicle or object |PARAMETER1=
|r1= [[Array]] - addon names


| [[Array]] - addon names |RETURNVALUE=
|x1= <sqf>hint str unitAddons typeOf player; // ["A3_Characters_F_BLUFOR"]</sqf>


|seealso= [[activateAddons]]
}}


|x1= <code>[[hint]] [[str]] [[unitAddons]] [[typeOf]] [[player]]; //["A3_Characters_F_BLUFOR"]</code>|EXAMPLE1=
{{Note
 
|user= ffur2007slx2_5
 
|timestamp= 20140331233800
| [[activateAddons]] |SEEALSO=
|text= <nowiki/>
 
# From {{arma3}} 1.14 <sqf>hint str ([player] call BIS_fnc_unitAddon) // same as unitAddons (typeOf player)</sqf>
|  |MPBEHAVIOUR=
# To return the addon that a weapon belongs to, use [[BIS_fnc_weaponAddon]] instead. E.g. <sqf>(primaryWeapon player call BIS_fnc_weaponAddon); // return: "A3_Weapons_F_Rifles_Khaybar"</sqf>
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on Mar 31, 2014 - 23:38
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]<dd class="note">
1. From A3 1.14
<code>[[hint]] [[str]] ([player] [[call]] [[BIS_fnc_unitAddon]]) // same as [[unitAddons]] ([[typeOf]] [[player]])</code>
2. To return the addon that a weapon belongs to, use [[BIS_fnc_weaponAddon]] instead. E.g.
<code>(([[primaryWeapon]] [[player]]) [[call]] [[BIS_fnc_weaponAddon]]); //return: "A3_Weapons_F_Rifles_Khaybar"</code>
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>

Latest revision as of 23:51, 13 May 2023

Hover & click on the images for description

Description

Description:
Returns list with addons the unit belongs to.
Groups:
Mods and Addons

Syntax

Syntax:
unitAddons className
Parameters:
className: String - class name of a unit/vehicle or object
Return Value:
Array - addon names

Examples

Example 1:
hint str unitAddons typeOf player; // ["A3_Characters_F_BLUFOR"]

Additional Information

See also:
activateAddons

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
ffur2007slx2_5 - c
Posted on Mar 31, 2014 - 23:38 (UTC)
  1. From Arma 3 1.14
    hint str ([player] call BIS_fnc_unitAddon) // same as unitAddons (typeOf player)
  2. To return the addon that a weapon belongs to, use BIS_fnc_weaponAddon instead. E.g.
    (primaryWeapon player call BIS_fnc_weaponAddon); // return: "A3_Weapons_F_Rifles_Khaybar"