getUnitTrait: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<br />" to "<br>")
Line 4: Line 4:
|arg= global |MParg=
|arg= global |MParg=
| Gets the current value of a trait of the given unit.
| Gets the current value of a trait of the given unit.
<br><br>
{{Informative | For the default values please visit [[setUnitTrait]].}} |DESCRIPTION=
For the default values please visit [[setUnitTrait]].


|DESCRIPTION=
|unit [[getUnitTrait]] skillName |SYNTAX=
|unit '''getUnitTrait''' skillName |SYNTAX=
|p1= Unit: [[Object]] |PARAMETER1=
|p1= Unit: [[Object]] |PARAMETER1=
|p2= skillName: [[String]] - Name of the skill |PARAMETER1=
|p2= skillName: [[String]] - Name of the skill |PARAMETER2=
| [[Bool]] or [[Scalar]] - Value of the trait <br> [[Nothing]] if unit is empty vehicle |RETURNVALUE=  
|
* [[Bool]] or [[Number]] - trait's value
* [[Nothing]] - if ''unit'' is invalid, e.g an empty vehicle |RETURNVALUE=
|x1= <code>[[player]] [[getUnitTrait]] "Medic";</code>|EXAMPLE1=  
|x1= <code>[[player]] [[getUnitTrait]] "Medic";</code>|EXAMPLE1=  
| [[setUnitTrait]]|SEEALSO=  
| [[setUnitTrait]], [[getAllUnitTraits]] |SEEALSO=  
|  |MPBEHAVIOUR=  
|  |MPBEHAVIOUR=
}}
}}


<h3 style='display:none'>Bottom Section</h3>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]


<h3 style='display:none'>Notes</h3>
<h3 style='display:none'>Notes</h3>

Revision as of 16:44, 5 June 2020

Hover & click on the images for description

Description

Description:
Gets the current value of a trait of the given unit.
For the default values please visit setUnitTrait.
Groups:
Uncategorised

Syntax

Syntax:
unit getUnitTrait skillName
Parameters:
Unit: Object
skillName: String - Name of the skill
Return Value:

Examples

Example 1:
player getUnitTrait "Medic";

Additional Information

See also:
setUnitTraitgetAllUnitTraits

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

Bottom Section

Notes

Bottom Section