Перейти к содержанию

Pathfind::getStreetNameAtCoord

Материал из RAGE MP Wiki Archive
Версия от 09:03, 17 ноября 2017; imported>Unknown
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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 UI::GET_STREET_NAME_FROM_HASH_KEY.

Syntax

<syntaxhighlight lang="javascript">mp.game.pathfind.getStreetNameAtCoord(x, y, z, streetName, crossingRoad);</syntaxhighlight>

Required Arguments

  • x: float
  • y: float
  • z: float
  • streetName: Hash
  • crossingRoad: Hash

Return value

  • object: streetName, crossingRoad

Example

<syntaxhighlight lang="javascript"> // 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} </syntaxhighlight>

If you want the real streetname you have to use: https://wiki.rage.mp/index.php?title=Ui::getStreetNameFromHashKey

See also

Шаблон:Pathfind s function c