getElementZoneName | Multi Theft Auto: Wiki Skip to content

getElementZoneName

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 an element (eg. Verdant Bluffs or Ocean Docks)

OOP Syntax Help! I don't understand this!

Syntax

string getElementZoneName ( element theElement, [ bool citiesonly = false ] )
Required Arguments
  • theElement: The element which you'd like to retrieve the zone name from
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 the city name (eg Las Venturas)

Returns

  • string: value

Returns the string of the elements zone name.

Code Examples

shared

This example shows you how to return your own location by doing /loc in the chatbox or just loc in console

function playerloc ( source )
local playername = getPlayerName ( source )
local location = getElementZoneName ( source )
outputChatBox ( "* " .. playername .. "'s Location: " .. location, getRootElement(), 0, 255, 255 ) -- Output the player's name and zone name
end
addCommandHandler ( "loc", playerloc )

See Also

Element Functions