getAllUnitTraits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\|Problems= * " to " ") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *Multiplayer Behaviour *= * " to " ") |
||
Line 15: | Line 15: | ||
|descr= Returns unit traits, native or set by [[setUnitTrait]]. | |descr= Returns unit traits, native or set by [[setUnitTrait]]. | ||
|mp | |mp= | ||
|pr= | |pr= |
Revision as of 16:28, 7 February 2021
Description
- Description:
- Returns unit traits, native or set by setUnitTrait.
- Groups:
- Object Manipulation
Syntax
- Syntax:
- getAllUnitTraits unit
- Parameters:
- unit: Object
- Return Value:
- Array of Arrays of [String, String/Boolean] - to format [["traitName1",value1], ["traitName2", value2]]
Examples
- Example 1:
/* can return: [ ["Medic", false], ["Engineer", false], ["ExplosiveSpecialist", false], ["UavHacker", false], ["CamouflageCoef", 1], ["AudibleCoef", 1], ["LoadCoef", 1], ["test", "custom"] ] */ private _playerTraits = getAllUnitTraits player;
- Example 2:
private _unitTraits = getAllUnitTraits _unit; private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; private _unitCanHeal = _unitTraits select (_indexes select 0) select 1;
Additional Information
- See also:
- setUnitTrait
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