getStreetNameAtCoord
GET_STREET_NAME_AT_COORD0x2EB41072B4C1E4C0The 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.
getStreetNameAtCoord(x: number, y: number, z: number): [
streetName: Hash,
crossingRoad: Hash
]getStreetNameAtCoord(x: number, y: number, z: number): Hash, HashUsage
const [streetName, crossingRoad] = getStreetNameAtCoord(x, y, z);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.
const [streetName, crossingRoad] = getStreetNameAtCoord(pos);local streetName, crossingRoad = getStreetNameAtCoord(pos)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
x | float | number | number |
y | float | number | number |
z | float | number | number |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | streetName | Hash | number | integer | output |
| 2 | crossingRoad | Hash | number | integer | output |
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