getZoneName | Multi Theft Auto: Wiki Skip to content

getZoneName

Client-side
Server-side
Shared

Manual Review Required

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

string getZoneName ( float x, float y, float z, [ bool citiesonly = false ] )
Required Arguments
  • x: The X axis position
  • y: The Y axis position
  • z: The Z axis position
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • citiesonly (default: false): An optional argument to choose if you want to return one of the following city names: Tierra Robada Bone County Las Venturas San Fierro Red County Whetstone Flint County Los Santos

Returns

  • string: value

Returns the string of the zone name.

Code Examples

shared

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