ACE3/TO_MERGE/cse/main/misc/functions/fn_getName.sqf

26 lines
528 B
Plaintext
Raw Normal View History

2015-01-12 22:35:40 +00:00
/**
* fn_getName.sqf
* @Descr: Get the name of unit
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: STRING Name of object
* @PublicAPI: true
*/
private["_unit","_return"];
_unit = _this select 0;
_return = "Unknown";
if (alive _unit) then {
if (_unit iskindof "CAManBase") then {
if (_unit getvariable ["cse_isDead",false]) then {
_return = _unit getvariable ["cse_name","Unknown"];
} else {
_return = name _unit;
};
};
} else {
_return = _unit getvariable ["cse_name","Unknown"];
};
_return