diff --git a/README.md b/README.md index 663eb8a..21041b0 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,29 @@ # streetLabel -streetLabel adds a hud much like **[Player Location Display](https://www.gta5-mods.com/scripts/player-location-display-v3-50)** by **LtCaine**. +streetLabel adds a slick UI on the bottom of your players display showing various information about their location on the HUD. This mod was inspired by **[Lt. Caine](https://www.gta5-mods.com/users/LtCine)**'s most popular client side mod known as **[Player Location Display](https://www.gta5-mods.com/scripts/player-location-display-v3-50)**. + +### Preview +![streetlabel-preview](https://i.imgur.com/0B7OxoA.png) ### Features -- Configuration file to change colors and position of each hud element. -- Ability to set hud to show *only when* players are in a vehicle. +- The left most portion of this mod will display the direction the player is currently facing. +- The top line of text will display the name of the street the player is currently on. +- The bottom line will show the name of the street around the player or city/town. +- Many customizable configuration options to customize the HUD to your liking, including colors & `vehicleCheck` ## Download & Installation ### Using Git ``` -cd resources +cd server-data/resources/ git clone https://github.com/lowheartrate/streetLabel ``` ### Manually -- Download and insert `streetLabel` folder into your **/server-data/resources/** directory. +- Download the most recent `.zip` file/archive from the **[releases](https://github.com/codibez/streetLabel/releases)** page. +- Extract the contents to your `server-data/resources/` directory. ## Installation -- Add this to your `server.cfg`: - +- Ensure you've added the following to your `server.cfg` file: ``` start streetLabel ``` diff --git a/client.lua b/client.lua new file mode 100644 index 0000000..f6dcd17 --- /dev/null +++ b/client.lua @@ -0,0 +1,82 @@ +-- Variables +local directions = { + N = 360, 0, + NE = 315, + E = 270, + SE = 225, + S = 180, + SW = 135, + W = 90, + NW = 45 + -- N = 0, <= will result in the HUD breaking above 315deg +} + +local veh = 0; +local streetHash1, streetHash2, playerDirection; + +Citizen.CreateThread(function() + + -- Wait a single second before sending data NUI message :? + Citizen.Wait(1000); + + SendNUIMessage({ + type = 'streetLabel:DATA', + border = config.border, + direction = config.direction, + zone = config.current, + street = config.crossing, + offsetX = config.position.offsetX, + offsetY = config.position.offsetY + }); + + while true do + local ped = GetPlayerPed(-1); + local veh = GetVehiclePedIsIn(ped, false); + + local coords = GetEntityCoords(PlayerPedId()); + local zone = GetNameOfZone(coords.x, coords.y, coords.z); + local zoneLabel = GetLabelText(zone); + + if(checkForVehicle == false or veh ~= 0) then + local var1, var2 = GetStreetNameAtCoord(coords.x, coords.y, coords.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger()) + streetHash1 = GetStreetNameFromHashKey(var1); + streetHash2 = GetStreetNameFromHashKey(var2); + playerDirection = GetEntityHeading(PlayerPedId()); + + for k, v in pairs(directions) do + if (math.abs(playerDirection - v) < 22.5) then + playerDirection = k; + + if (playerDirection == 1) then + playerDirection = 'N'; + break; + end + + break; + end + end + + local street2 = ''; + if (streetHash2 == '') then + street2 = zoneLabel; + else + street2 = streetHash2..', '..zoneLabel; + end + + SendNUIMessage({ + type = 'streetLabel:MSG', + active = true, + direction = playerDirection, + zone = streetHash1, + street = street2 + }); + else + SendNUIMessage({ + type = 'streetLabel:MSG', + active = false + }); + end + -- Wait for half a second. + Citizen.Wait(500); + end +end) \ No newline at end of file diff --git a/config.lua b/config.lua new file mode 100644 index 0000000..bad94fe --- /dev/null +++ b/config.lua @@ -0,0 +1,42 @@ +config = { + -- Customization options + border = { + r = 255; + g = 255; + b = 255; + a = 0.65; + size = 4; + }; + + current = { + r = 255; + g = 255; + b = 255; + a = 0.9; + size = 1.45; + }; + + crossing = { + r = 240; + g = 220; + b = 80; + a = 0.9; + size = 2; + }; + + direction = { + r = 240; + g = 220; + b = 80; + a = 0.9; + size = 3.5; + }; + + position = { + -- 0:100 + offsetX = 17; + offsetY = 2.5; + }; + + vehicleCheck = true; -- Rather or not to display HUD when player(s) are inside a vehicle +} \ No newline at end of file diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 0000000..c4fde55 --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,21 @@ +-- Script Description +fx_version 'cerulean' +games { 'gta5' } + +author 'lowheartrate & Slyforn' +description 'Street Label by lowheartrate' +version '1.1.0' + +-- Client Scripts +client_scripts { + 'config.lua', + 'client.lua' +} + +ui_page('html/index.html') + +files({ + 'html/index.html', + 'html/listener.js', + 'html/style.css' +}) \ No newline at end of file diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..f3a61af --- /dev/null +++ b/html/index.html @@ -0,0 +1,28 @@ + + + + + + + + Street Label + + + + + + +
+
+ | +

+ | +
+ +
+

+

+
+
+ + \ No newline at end of file diff --git a/html/listener.js b/html/listener.js new file mode 100644 index 0000000..cfa0f23 --- /dev/null +++ b/html/listener.js @@ -0,0 +1,58 @@ +window.onload = (e) => { + window.addEventListener('message', onMessageRecieved); +}; + +function onMessageRecieved(event){ + let item = event.data; + + if (item && item.type === 'streetLabel:MSG') { + if (!item.active) { + $("#container").hide(); + } else { + $("#container").show(); + + let direction = item.direction; + let zone = item.zone; + let street = item.street; + + $('#direction').text(direction); + $('#zone').text(zone); + $('#street').text(street); + } + } + + if (item && item.type === 'streetLabel:DATA') { + let container = document.getElementById('container'); + + /* color customization */ + let border = [item.border.r, item.border.g, item.border.b, item.border.a]; + let borderDOM = document.querySelectorAll('#border'); + + let direction = [item.direction.r, item.direction.g, item.direction.b, item.direction.a]; + let zone = [item.zone.r, item.zone.g, item.zone.b, item.zone.a]; + let street = [item.street.r, item.street.g, item.street.b, item.street.a]; + + // jQuery #direction to proper color & font-size configuration + $('#direction').css('color', 'rgba('+direction.join(', ')+')'); + $('#direction').css('font-size', item.direction.size + 'vw'); + + // jQuery #street to proper color & font-size configuration + $('#street').css('color', 'rgba('+street.join(', ')+')'); + $('#street').css('font-size', item.street.size + 'vw'); + + // jQuery #zone to proper color & font-size configuration + $('#zone').css('color', 'rgba('+zone.join(', ')+')'); + $('#zone').css('font-size', item.zone.size + 'vw'); + + for (let i=0; i < borderDOM.length; i++) { + borderDOM[i].style.color = 'rgba('+border.join(', ')+')'; + borderDOM[i].style.fontSize = item.border.size + 'vw'; + } + + /* HUD position */ + if (item.offsetX) { container.style.left = item.offsetX + '%' } + if (item.offsetY) { container.style.bottom = item.offsetY + '%' } + + /* view */ + } +} \ No newline at end of file diff --git a/html/style.css b/html/style.css new file mode 100644 index 0000000..b1ef6b4 --- /dev/null +++ b/html/style.css @@ -0,0 +1,37 @@ +/* googleFonts */ +@import url('https://fonts.googleapis.com/css2?family=Archivo&display=swap'); + +/* General styling */ +* { + box-sizing: border-box; + font-family: 'Archivo', sans-serif; + margin: 0; padding: 0; +} + +#container { + align-items: center; + color: rgb(241, 235, 235); + display: flex; + flex-direction: row; + justify-content: center; + padding: 0 10px; + position: absolute; +} + +#container > section { + align-items: center; + display: flex; + flex-direction: row; + justify-content: center; +} + +#container > div { + display: flex; + flex-direction: column; + justify-content: space-between; +} + +#direction, #zone, #street { + text-shadow: 2px 2px 3px rgba(0,0,0,0.45); + margin: 0 5px; +} \ No newline at end of file diff --git a/streetLabel/__resource.lua b/streetLabel/__resource.lua deleted file mode 100644 index 63ea5c9..0000000 --- a/streetLabel/__resource.lua +++ /dev/null @@ -1,11 +0,0 @@ --- Manifest -resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' - --- Script Description -description 'Street Label byLowheartrate' - --- Client Scripts -client_scripts { - 'config.lua', - 'client.lua' -} diff --git a/streetLabel/client.lua b/streetLabel/client.lua deleted file mode 100644 index c762933..0000000 --- a/streetLabel/client.lua +++ /dev/null @@ -1,230 +0,0 @@ -function drawTxt(x,y ,width,height,scale, text, r,g,b,a) - if not HideHud then - SetTextFont(4) - SetTextProportional(0) - SetTextScale(scale, scale) - SetTextColour(r, g, b, a) - SetTextDropShadow(0, 0, 0, 0,255) - SetTextEdge(1, 0, 0, 0, 255) - SetTextDropShadow() - SetTextOutline() - SetTextEntry("STRING") - AddTextComponentString(text) - DrawText(x - width/2, y - height/2 + 0.005) - end -end - -function drawTxt2(x,y ,width,height,scale, text, r,g,b,a) - if not HideHud then - SetTextFont(6) - SetTextProportional(0) - SetTextScale(scale, scale) - SetTextColour(r, g, b, a) - SetTextDropShadow(0, 0, 0, 0,255) - SetTextEdge(1, 0, 0, 0, 255) - SetTextDropShadow() - SetTextOutline() - SetTextEntry("STRING") - AddTextComponentString(text) - DrawText(x - width/2, y - height/2 + 0.005) - end -end - -local directions = { [0] = 'N', [45] = 'NW', [90] = 'W', [135] = 'SW', [180] = 'S', [225] = 'SE', [270] = 'E', [315] = 'NE', [360] = 'N', } -Citizen.CreateThread(function() - while true do - Citizen.Wait(1) - - local ped = GetPlayerPed(-1) - local vehicle = GetVehiclePedIsIn(ped, false) - local directions = { [0] = 'N', [45] = 'NW', [90] = 'W', [135] = 'SW', [180] = 'S', [225] = 'SE', [270] = 'E', [315] = 'NE', [360] = 'N', } - - local pos = GetEntityCoords(PlayerPedId()) - local var1, var2 = GetStreetNameAtCoord(pos.x, pos.y, pos.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger()) - local current_zone = GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)) - - for k,v in pairs(directions)do - direction = GetEntityHeading(PlayerPedId()) - if(math.abs(direction - k) < 22.5)then - direction = v - break - end - end - - if (checkForVehicle == false) then - if GetStreetNameFromHashKey(var1) and GetNameOfZone(pos.x, pos.y, pos.z) then - if GetStreetNameFromHashKey(var1) then - if direction == 'N' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.306, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.285, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'NE' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.298, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.277, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.277, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.277, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1),curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'E' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.309, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.288, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.288, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.288, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'SE' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.298, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.275, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.275, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.275, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'S' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.307, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.285, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'SW' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.292, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.270, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.270, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.270, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'W' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.303, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.280, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.280, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.280, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'NW' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.290, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.266, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.266, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.266, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - end - end - end - else - if (vehicle ~= 0) then - if GetStreetNameFromHashKey(var1) and GetNameOfZone(pos.x, pos.y, pos.z) then - if GetStreetNameFromHashKey(var1) then - if direction == 'N' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.306, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.285, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'NE' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.298, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.277, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.277, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.277, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1),curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'E' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.309, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.288, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.288, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.288, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'SE' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.298, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.275, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.275, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.275, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'S' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.307, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.285, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.285, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'SW' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.292, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.270, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.270, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.270, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'W' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.303, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.280, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.280, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.280, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - elseif direction == 'NW' then - drawTxt(x-0.335, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.290, y+0.66, 1.0,1.5,1.4, " | ", border_r, border_g, border_b, border_a) - drawTxt(x-0.315, y+0.42, 1.0,1.0,1.0, direction, dir_r, dir_g, dir_b, dir_a) - if GetStreetNameFromHashKey(var2) == "" then - drawTxt2(x-0.266, y+0.45, 1.0,1.0,0.45, current_zone, town_r, town_g, town_b, town_a) - else - drawTxt2(x-0.266, y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), str_around_r, str_around_g, str_around_b, str_around_a) - end - drawTxt2(x-0.266, y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), curr_street_r, curr_street_g, curr_street_b, curr_street_a) - end - end - end - end - end - end -end) \ No newline at end of file diff --git a/streetLabel/config.lua b/streetLabel/config.lua deleted file mode 100644 index 76c4e74..0000000 --- a/streetLabel/config.lua +++ /dev/null @@ -1,40 +0,0 @@ --- Use the following variable(s) to adjust the position. - -- adjust the x-axis (left/right) - x = 1.000 - -- adjust the y-axis (top/bottom) - y = 1.000 --- If you do not see the HUD after restarting script you adjusted the x/y axis too far. - --- Use the following variable(s) to adjust the color(s) of each element. - -- Use the following variables to adjust the color of the border around direction. - border_r = 255 - border_g = 255 - border_b = 255 - border_a = 100 - - -- Use the following variables to adjust the color of the direction user is facing. - dir_r = 255 - dir_g = 255 - dir_b = 255 - dir_a = 255 - - -- Use the following variables to adjust the color of the street user is currently on. - curr_street_r = 240 - curr_street_g = 200 - curr_street_b = 80 - curr_street_a = 255 - - -- Use the following variables to adjust the color of the street around the player. (this will also change the town the user is in) - str_around_r = 255 - str_around_g = 255 - str_around_b = 255 - str_around_a = 255 - - -- Use the following variables to adjust the color of the city the player is in (without there being a street around them) - town_r = 255 - town_g = 255 - town_b = 255 - town_a = 255 - - -- Determine rather the HUD should only display when player(s) are inside a vehicle or not - checkForVehicle = true \ No newline at end of file