getZoneName | Multi Theft Auto: Wiki Skip to content

getZoneName

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to retrieve the zone name of a certain location.

Syntax

getZoneName ( )

Code Examples

server

Example 1:This example returns the player's City & Zone.

function outputPlayerZone(thePlayer)
-- get the player position
x, y, z = getElementPosition(thePlayer)
-- get the player zone
zone = getZoneName(x, y, z)
-- get the player city (citiesonly as true)
city = getZoneName(x, y, z, true)
-- output to local player's chatbox
outputChatBox("City: ".. city .." / Zone: ".. zone, thePlayer)
end
addCommandHandler("getloc", outputPlayerZone)

See Also

World Functions