ZonesClient

getHashOfMapAreaAtCoords

GET_HASH_OF_MAP_AREA_AT_COORDS0x7EE64D51E8498728

The GTA V native GET_HASH_OF_MAP_AREA_AT_COORDS of the ZONE namespace, as LS:MP client scripts call it: the global function getHashOfMapAreaAtCoords, in JavaScript and in Lua.

SignatureJavaScript
getHashOfMapAreaAtCoords(x: number, y: number, z: number): Hash
SignatureLua
getHashOfMapAreaAtCoords(x: number, y: number, z: number): Hash

Usage

JavaScript
const hash = getHashOfMapAreaAtCoords(x, y, z);
Lua
local hash = getHashOfMapAreaAtCoords(x, y, z)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const hash = getHashOfMapAreaAtCoords(pos);
Lua · with vectors
local hash = getHashOfMapAreaAtCoords(pos)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

Hash JavaScript number, Lua integer

A game hash. Natives return it unsigned (0 to 4294967295), the value lsmp.hash gives. As an argument, the signed and unsigned forms of a hash are the same value.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns a hash representing which part of the map the given coords are located.

Possible return values:
(Hash of) city -> -289320599
(Hash of) countryside -> 2072609373

C# Example :

Ped player = Game.Player.Character;
Hash h = Function.Call<Hash>(Hash.GET_HASH_OF_MAP_AREA_AT_COORDS, player.Position.X, player.Position.Y, player.Position.Z);

Reference

Namespace
Zones ZONE
In the game
Hash GET_HASH_OF_MAP_AREA_AT_COORDS(float x, float y, float z)
Hash
0x7EE64D51E8498728

Open in the interactive natives reference