oh btw, player position:
Lua Code:
local playerUnitTag = "player"
--- @return zoneId integer, worldX integer, worldY integer, worldZ integer
local zoneId, worldX, worldY, worldZ = GetUnitWorldPosition(playerUnitTag)
local zoneId, worldX, worldY, worldZ = GetUnitRawWorldPosition(playerUnitTag)
--- @return normalizedX number, normalizedZ number, heading number, isShownInCurrentMap bool
local normalizedX, normalizedZ, heading, isShownInCurrentMap = GetMapPlayerPosition(playerUnitTag)
Maybe some libs can help here too, check the Lib descriptions for the ones relating to maps, positions, etc. and also to calculate between normalized and actual positions (not sure which lib was supporting this, maybe LibMapPin or LibGPS?).