WoW:API UnitRace: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 3: Line 3:
Returns the race (Tauren, Orc, etc) of the specified unit.
Returns the race (Tauren, Orc, etc) of the specified unit.
   
   
  race = UnitRace("unit");
  race, raceEn = UnitRace("unit");
----
----
;''Arguments''
;''Arguments''
Line 14: Line 14:




:;race : The race of the specified unit as a string.  e.g. Tauren, Orc, Guerrier, etc.
:;race : The localized race of the specified unit as a string.  e.g. Tauren, Orc etc.
 
:;raceEn : The race in english as a string. e.g Tauren, Orc etc.


----
----

Revision as of 19:39, 11 August 2005

UnitRace -Documentation by The_ED-

Returns the race (Tauren, Orc, etc) of the specified unit.

race, raceEn = UnitRace("unit");

Arguments
("unit")
unit
String - The UnitId to get information from.

Returns


race
The localized race of the specified unit as a string. e.g. Tauren, Orc etc.
raceEn
The race in english as a string. e.g Tauren, Orc etc.

Example
local race = UnitRace("player");
ChatFrame1:AddMessage('Your player is a : ' .. race .. );
Result
Prints the player's race to the chat frame as

'Your player is a : Tauren'.  (Or whichever race the specified unit is)