RAGE.Game.Ui.GetStreetNameFromHashKey

From RAGE Multiplayer Wiki
Revision as of 10:25, 5 May 2020 by MisterJ (talk | contribs) (Created page with "This functions converts the hash of a street name into a readable string.<br><br>Note: The names are returned as string, the hashes can be obtained by using the function RAGE....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This functions converts the hash of a street name into a readable string.

Note: The names are returned as string, the hashes can be obtained by using the function RAGE.Game.Pathfind.GetStreetNameAtCoord(x, y, z, ref streetName, ref crossingRoad).

Syntax

RAGE.Game.Ui.GetStreetNameFromHashKey((uint) hash);

Required Arguments

  • hash: (uint) hash

Return value

  • string: streetName or crossingRoad

Example

// 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 = RAGE.Game.Ui.GetStreetNameFromHashKey((uint) tempCrossingRoad);
    }

    return tempResult;
}