Description
Returns name of a unit. Name of unit is stored in it is namespace so it can be retrieved later, mainly for when unit dies. Name is stored in the variable BIS_fnc_getName_name.
If the unit is alive, this function does name and returns the result, and saves the result to the variable on the unit. If the unit is dead, the function tries to retrieve the saved name from the variable on the unit, and returns "" if none is saved, unless forcedWhenDead is set to true.
Syntax
[object] call BIS_fnc_getName
Parameters:
object: Object - object whose name should be returnedforcedWhenDead: Boolean - (Optional, default false) forces the function to do name on the unit if it's dead and has no name saved in the variable. Might have inconsistent results.maxCharacters: Number - (Optional, default -1) the name returned will be limited to this length. -1 for no limit. The name saved to the variable is not limited.
Returns: String - unit's name
Examples
Example 1
[player] call BIS_fnc_getName;