Try this:
Lua Code:
local zoneIndex, poiIndex = GetCurrentSubZonePOIIndices()
if poiIndex then
local normalizedX, normalizedZ, poiType, iconPath = GetPOIMapInfo(zoneIndex, poiIndex)
if iconPath:find("poi_city") then
-- in a city
end
end
Should work in any language.