WoW:API UnitName: Difference between revisions
Jump to navigation
Jump to search
UnitName -Documentation by octon-
m (Added further examples for valid unit specifications) |
(Updated format, added UnitId link) |
||
Line 1: | Line 1: | ||
<center>'''UnitName''' ''-Documentation by [[User:Octon|octon]]-''</center> | <center>'''UnitName''' ''-Documentation by [[User:Octon|octon]]-''</center> | ||
name = UnitName("unit"); | |||
Returns the name of the specified unit. | Returns the name of the specified unit. | ||
Line 6: | Line 8: | ||
;''Arguments'' | ;''Arguments'' | ||
:( | :(unit) | ||
:; | :;unit : String - The [[API TYPE UnitId|UnitId]] to query (e.g. "player", "party2", "pet", "target" etc.) | ||
---- | ---- | ||
Line 14: | Line 16: | ||
:name | :name | ||
:;name : The name of the specified unit | :;name : String - The name of the specified unit. | ||
---- | ---- |
Revision as of 21:00, 4 January 2005
name = UnitName("unit");
Returns the name of the specified unit.
- Arguments
- (unit)
- unit
- String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)
- Returns
- name
- name
- String - The name of the specified unit.
- Example
local playerName = UnitName("player"); ChatFrame1:AddMessage('Hi my name is: ' .. playerName);
- Result
Prints the player's name to the chat frame as 'Hi my name is: Octon'.
- Description
- Returns the name of the specified unit.