i think a better way is the follow:
local pl, rn = UnitFullName ("player")
self.PlyrName = pl.."-"..rn
so it's faster, i think...
from wowpedia:
API UnitFullName
Returns the player's (unit's) name and server.
fullName, realm = UnitFullName("unit")
Arguments
unit
String - unitId to query; the only intended value is "player".
Returns
name
String - unit's name (with no realm suffix), e.g. "Shion".
realm
String - unit's realm of origin, e.g. "TarrenMill", if different from the player's own, or no value if the same as the player's own realm (see Details).
Details
This function is equivalent to UnitName if called with any other unitId than "player". When called with "player" as the argument, realm is always returned.
Last edited by DeaTHCorEKiD : 02-22-14 at 12:30 PM.
|