GetZoneName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (optinal arg in syntax)
Line 4: Line 4:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string getZoneName ( float x, float y, float z, bool citiesonly )
string getZoneName ( float x, float y, float z, [bool citiesonly=false] )
</syntaxhighlight>
</syntaxhighlight>



Revision as of 16:30, 18 November 2006

This function allows you to retrieve the zone name of 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. For more information on optional arguments, see optional arguments.

  • citiesonly: An optional argument to choose if you want to return the city name (eg Las Venturas)

Returns

Returns the string of the zone name

Example

This example shows you how to return a zone name by doing /loc x y z in the chatbox or just loc x y z in console ( replace x, y and z with the co-ords you wanna check, eg /loc 1200 523 12.3 )

addCommandHandler("loc", "playerloc")
function playerloc ( source, command, x, y, z )
  local location = getZoneName ( x, y, z )
  outputChatBox ( "* Location: " ..location, root, 0, 255, 255 ) -- Output the zone name
end

See Also