WoW:API UnitFactionGroup: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Get the [[API_TYPE_UnitId|UnitID]] faction
Get the name of the faction (Horde/Alliance) a unit belongs to.
  englishFaction, localizedFaction = UnitFactionGroup([[API_TYPE_UnitId|UnitID]])
  englishFaction, localizedFaction = UnitFactionGroup(unit)


== Arguments ==
== Arguments ==
; [[API_TYPE_UnitId|UnitID]] : String - Unit ID you want to get the faction for
; unit : String - [[API_TYPE_UnitId|UnitID]] you want to get the faction for


== Returns ==
== Returns ==
;englishFaction : String - Faction name of the [[API_TYPE_UnitId|UnitID]] in English.
;englishFaction : String - Unit's faction name in English.
;localizedFaction : String - Localized version of the faction name.
;localizedFaction : String - Unit's faction name in the client's locale.


== Details ==
== Details ==
Used to retrieve the [[API_TYPE_UnitId|UnitID]] faction ([[Horde]] or [[Alliance]]), this can be called at PLAYER_ENTERING_WORLD with a player [[API_TYPE_UnitId|UnitID]].
The functon returns correct results after the PLAYER_ENTERING_WORLD event.

Revision as of 20:05, 7 August 2007

WoW API < UnitFactionGroup

Get the name of the faction (Horde/Alliance) a unit belongs to.

englishFaction, localizedFaction = UnitFactionGroup(unit)

Arguments

unit
String - UnitID you want to get the faction for

Returns

englishFaction
String - Unit's faction name in English.
localizedFaction
String - Unit's faction name in the client's locale.

Details

The functon returns correct results after the PLAYER_ENTERING_WORLD event.