Ui::getStreetNameFromHashKey: Difference between revisions

From RAGE Multiplayer Wiki
(You don't include credits to articles in wiki, the history is itself credits)
 
Line 18: Line 18:


To retrieve the street hashes go to: https://wiki.rage.mp/index.php?title=Pathfind::getStreetNameAtCoord
To retrieve the street hashes go to: https://wiki.rage.mp/index.php?title=Pathfind::getStreetNameAtCoord
Credits to Splak


==See also==
==See also==

Latest revision as of 20:23, 18 November 2017

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

For how to get the hashes, see PATHFIND::GET_STREET_NAME_AT_COORD.

Syntax

mp.game.ui.getStreetNameFromHashKey(hash);

Required Arguments

  • hash: Model hash or name

Return value

  • String

Example

// Clientside
const local = mp.players.local;
let getStreet = mp.game.pathfind.getStreetNameAtCoord(local.position.x, local.position.y, local.position.z, 0, 0);
// Returns obj {"streetName": hash, crossingRoad: hash}

let streetName = mp.game.ui.getStreetNameFromHashKey(getStreet.streetName); // Return string, if exist
let crossingRoad  = mp.game.ui.getStreetNameFromHashKey(getStreet.crossingRoad); // Return string, if exist

To retrieve the street hashes go to: https://wiki.rage.mp/index.php?title=Pathfind::getStreetNameAtCoord

See also