RAGE.Game.Pathfind.GetStreetNameAtCoord
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 as int to the name of the street the coords are on crossingRoad - if the coordinates are on an intersection, a hash as int to the name of the crossing road
Note: The names are returned as hash as int, the strings can be returned using the function RAGE.Game.Ui.GetStreetNameFromHashKey((uint) hash as int).
Syntax
```csharp RAGE.Game.Pathfind.GetStreetNameAtCoord(x, y, z, ref streetName, ref crossingRoad); ```
Required Arguments
- x: float
- y: float
- z: float
- streetName: ref int
- crossingRoad: ref int
Return value
- hash as int: streetName, crossingRoad
Example
```csharp // Clientside public string GetActualStreetName() {
var local = RAGE.Elements.Player.LocalPlayer;
var tempStreetName = 0;
var tempCrossingRoad = 0;
var tempResult = string.Empty;
RAGE.Game.Pathfind.GetStreetNameAtCoord(local.Position.X, local.Position.Y, local.Position.Z, ref tempStreetName, ref tempCrossingRoad);
if (tempStreetName != 0)
\{
tempResult = RAGE.Game.Ui.GetStreetNameFromHashKey((uint) tempStreetName);
\}
if (tempCrossingRoad != 0)
\{
tempResult = Ui.GetStreetNameFromHashKey((uint) tempCrossingRoad);
\}
return tempResult;
} ```
If you want the real streetname you have to use: <https://wiki.rage.mp/index.php?title=RAGE.Game.Ui.GetStreetNameFromHashKey>