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 HarvestMap — its ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.
Most-downloaded addons using it
| Addon | Total downloads |
|---|---|
| HarvestMap | 9,454,533 |
| Code's Combat Alerts | 4,445,158 |
| Votan's Minimap | 4,211,718 |
| RaidNotifier Updated | 2,789,746 |
| LibZone | 1,937,031 |
| Item Set Browser | 1,893,031 |