getAllUnitTraits: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|(arg|eff|serverExec|mp|seealso)= " to "") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 14: | Line 14: | ||
|p1= unit: [[Object]] | |p1= unit: [[Object]] | ||
|r1= [[Array]] of [[Array]]s | |r1= [[Array]] of [[Array]]s in format [name, value] where: | ||
* name: [[String]] - trait's name | |||
* value [[String]] or [[Boolean]] - trait's value | |||
|x1= < | |x1= <sqf> | ||
/* can return: | |||
[ | [ | ||
["Medic", false], | ["Medic", false], | ||
Line 27: | Line 30: | ||
["test", "custom"] | ["test", "custom"] | ||
] | ] | ||
*/ | |||
private _playerTraits = getAllUnitTraits player; | |||
</sqf> | |||
|x2= < | |x2= <sqf> | ||
private _unitTraits = getAllUnitTraits _unit; | |||
private _indexes = [_unitTraits, "Medic"] call BIS_fnc_findNestedElement; | |||
private _unitCanHeal = _unitTraits select (_indexes select 0) select 1; | |||
</sqf> | |||
|seealso= [[setUnitTrait]] | |seealso= [[setUnitTrait]] | ||
}} | }} |
Revision as of 11:43, 4 May 2022
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 in format [name, value] where:
Examples
- Example 1:
- Example 2:
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