ESODecoded

GetUnitZoneIndex

ESO Lua API function — used by 199 of the 3,030 addons we indexed (combined 38,411,776 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.

Official signature

GetUnitZoneIndex(string unitTag)

Returns: luaindex:nilable zoneIndex

Real usage — from HarvestMap

	if not Harvest.IsPinTypeSavedOnGather(pinTypeId) then return end
	if mapMetaData.zoneIndex ~= GetUnitZoneIndex("player") then
		self:Warn("tried to save node in wrong zone: %d, %d, %s",

Short excerpt from the shipping addon HarvestMapits ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.

Most-downloaded addons using it

AddonTotal downloads
HarvestMap9,454,533
Code's Combat Alerts4,445,158
Votan's Minimap4,211,718
RaidNotifier Updated2,789,746
LibZone1,937,031
Item Set Browser1,893,031