Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawTxt(x,y ,width,height,scale, text, r,g,b,a)
- 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
- function drawTxt2(x,y ,width,height,scale, text, r,g,b,a)
- 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
- RegisterNetEvent('normalDisplay')
- AddEventHandler('normalDisplay', function()
- if GetStreetNameFromHashKey(var1) and GetNameOfZone(pos.x, pos.y, pos.z) then
- if GetStreetNameFromHashKey(var1) then
- if direction == 'N' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.306, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.285, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.285, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.285, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'NE' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.298, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.277, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.277, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.277, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1),Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'E' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.309, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.288, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.288, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.288, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'SE' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.298, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.275, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.275, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.275, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'S' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.307, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.285, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.285, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.285, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'SW' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.292, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.270, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.270, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.270, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'W' then
- drawTxt(Config.x-0.335, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.303, Config.y+0.66, 1.0,1.5,1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.280, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.280, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.280, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- elseif direction == 'NW' then
- drawTxt(Config.x-0.335, Config.y+0.66,1.0, 1.5, 1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.Config.x-0.290, Config.y+0.66,1.0, 1.5, 1.4, " | ", Config.border_r, Config.border_g, Config.border_b, Config.border_a)
- drawTxt(Config.Config.x-0.315, Config.y+0.42, 1.0,1.0,1.0, direction, Config.dir_r, Config.dir_g, Config.dir_b, Config.dir_a)
- if GetStreetNameFromHashKey(var2) == "" then
- drawTxt2(Config.x-0.266, Config.y+0.45, 1.0,1.0,0.45, current_zone, Config.town_r, Config.town_g, Config.town_b, Config.town_a)
- else
- drawTxt2(Config.x-0.266, Config.y+0.45, 1.0,1.0,0.45, GetStreetNameFromHashKey(var2) .. ", " .. GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z)), Config.str_around_r, Config.str_around_g, Config.Config.str_around_b, Config.str_around_a)
- end
- drawTxt2(Config.x-0.266, Config.y+0.42, 1.0,1.0,0.55, GetStreetNameFromHashKey(var1), Config.curr_street_r, Config.curr_street_g, Config.curr_street_b, Config.curr_street_a)
- end
- end
- end
- end)
- directions = { [0] = 'N', [45] = 'NW', [90] = 'W', [135] = 'SW', [180] = 'S', [225] = 'SE', [270] = 'E', [315] = 'NE', [360] = 'N', }
- if Config.Display == 'normal' then
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(10)
- pos = GetEntityCoords(PlayerPedId())
- var1, var2 = GetStreetNameAtCoord(pos.x, pos.y, pos.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())
- 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
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1)
- TriggerEvent('normalDisplay')
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment