ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getCityName

Function

getCityName

Server and clientWorldTrilogy Hub only

Returns the map region name at a point ("Los Santos", "San Fierro", "Las Venturas", "Red County", "Flint County", "Whetstone", "Bone County", "Tierra Robada"); the same as getZoneName(x, y, z, true).

Syntax

string getCityName(float x, float y [, float z = 0])

Arguments

xfloat
X coordinate (or a vector).
yfloat
Y coordinate.
zfloat, optional = 0
Z height.

Returns

The region name, or "Unknown".

Example

addEventHandler("onPlayerSpawn", root, function()
    local x, y, z = getElementPosition(source)
    outputChatBox("Witaj w " .. getCityName(x, y, z), source)
end)

See also