getAllUnitTraits: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
mNo edit summary
Line 10: Line 10:


|serverExec=  |Multiplayer Execution ("server" or empty)=
|serverExec=  |Multiplayer Execution ("server" or empty)=
|gr1= Object Manipulation |GROUP1=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 09:28, 24 September 2020

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version |?]]
Hover & click on the images for description

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

[[Category:Introduced with arma3dev version ]][[ Category: arma3dev: New Scripting Commands | GETALLUNITTRAITS]][[ Category: arma3dev: Scripting Commands | GETALLUNITTRAITS]]

Bottom Section