PathfindingClient2 outputs

getStreetNameAtCoord

GET_STREET_NAME_AT_COORD0x2EB41072B4C1E4C0

The GTA V native GET_STREET_NAME_AT_COORD of the PATHFIND namespace, as LS:MP client scripts call it: the global function getStreetNameAtCoord, in JavaScript and in Lua.

SignatureJavaScript
getStreetNameAtCoord(x: number, y: number, z: number): [
  streetName: Hash,
  crossingRoad: Hash
]
SignatureLua
getStreetNameAtCoord(x: number, y: number, z: number): Hash, Hash

Usage

JavaScript
const [streetName, crossingRoad] = getStreetNameAtCoord(x, y, z);
Lua
local streetName, crossingRoad = getStreetNameAtCoord(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 [streetName, crossingRoad] = getStreetNameAtCoord(pos);
Lua · with vectors
local streetName, crossingRoad = getStreetNameAtCoord(pos)

Parameters

ParameterTypeJavaScriptLua
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1streetNameHashnumberintegeroutput
2crossingRoadHashnumberintegeroutput

Notes

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

Determines the name of the street which is the closest to the given coordinates.

x,y,z - the coordinates of the street
streetName - returns a hash to the name of the street the coords are on
crossingRoad - if the coordinates are on an intersection, a hash to the name of the crossing road

Note: the names are returned as hashes, the strings can be returned using the function getStreetNameFromHashKey.

Reference

Namespace
Pathfinding PATHFIND
In the game
void GET_STREET_NAME_AT_COORD(float x, float y, float z, Hash* streetName, Hash* crossingRoad)
Hash
0x2EB41072B4C1E4C0

Open in the interactive natives reference