├── README.md ├── config.lua ├── fxmanifest.lua ├── html ├── eusign.png ├── index.css ├── index.html ├── index.js └── sign.png └── nui.lua /README.md: -------------------------------------------------------------------------------- 1 | # speedlimit 2 | SpeedlimitUI FiveM 3 | 4 | This is a Speed limit UI that appears when driving. Big thanks to https://github.com/Big-Yoda/Posted-Speedlimit for the speedlimit aspect of it, it has no requirements either. 5 | 6 | Join the discord for support: https://discord.gg/2FAcPUmUWq 7 | 8 | 9 | Qries 10 | 11 | -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.Command = 'movesign' 4 | 5 | Config.Speed = 'mph' --This can either be mph or kph. If it does not match either of these options it defaults to mph 6 | 7 | Config.Speedlimits = { 8 | ["Joshua Rd"] = 60, 9 | ["East Joshua Road"] = 60, 10 | ["Marina Dr"] = 35, 11 | ["Alhambra Dr"] = 35, 12 | ["Niland Ave"] = 35, 13 | ["Zancudo Ave"] = 35, 14 | ["Armadillo Ave"] = 35, 15 | ["Algonquin Blvd"] = 35, 16 | ["Mountain View Dr"] = 35, 17 | ["Cholla Springs Ave"] = 35, 18 | ["Panorama Dr"] = 40, 19 | ["Lesbos Ln"] = 35, 20 | ["Calafia Rd"] = 30, 21 | ["North Calafia Way"] = 30, 22 | ["Cassidy Trail"] = 25, 23 | ["Seaview Rd"] = 35, 24 | ["Grapeseed Main St"] = 35, 25 | ["Grapeseed Ave"] = 35, 26 | ["Joad Ln"] = 35, 27 | ["Union Rd"] = 40, 28 | ["O'Neil Way"] = 25, 29 | ["Senora Fwy"] = 75, 30 | ["Catfish View"] = 35, 31 | ["Great Ocean Hwy"] = 75, 32 | ["Paleto Blvd"] = 35, 33 | ["Duluoz Ave"] = 35, 34 | ["Procopio Dr"] = 35, 35 | ["Cascabel Ave"] = 30, 36 | ["Procopio Promenade"] = 25, 37 | ["Pyrite Ave"] = 30, 38 | ["Fort Zancudo Approach Rd"] = 25, 39 | ["Barbareno Rd"] = 30, 40 | ["Ineseno Road"] = 30, 41 | ["West Eclipse Blvd"] = 35, 42 | ["Playa Vista"] = 30, 43 | ["Bay City Ave"] = 30, 44 | ["Del Perro Fwy"] = 75, 45 | ["Equality Way"] = 30, 46 | ["Red Desert Ave"] = 30, 47 | ["Magellan Ave"] = 25, 48 | ["Sandcastle Way"] = 30, 49 | ["Vespucci Blvd"] = 40, 50 | ["Prosperity St"] = 30, 51 | ["San Andreas Ave"] = 40, 52 | ["North Rockford Dr"] = 35, 53 | ["South Rockford Dr"] = 35, 54 | ["Marathon Ave"] = 30, 55 | ["Boulevard Del Perro"] = 35, 56 | ["Cougar Ave"] = 30, 57 | ["Liberty St"] = 30, 58 | ["Bay City Incline"] = 40, 59 | ["Conquistador St"] = 25, 60 | ["Cortes St"] = 25, 61 | ["Vitus St"] = 25, 62 | ["Aguja St"] = 25, 63 | ["Goma St"] = 25, 64 | ["Melanoma St"] = 25, 65 | ["Palomino Ave"] = 35, 66 | ["Invention Ct"] = 25, 67 | ["Imagination Ct"] = 25, 68 | ["Rub St"] = 25, 69 | ["Tug St"] = 25, 70 | ["Ginger St"] = 30, 71 | ["Lindsay Circus"] = 30, 72 | ["Calais Ave"] = 35, 73 | ["Adam's Apple Blvd"] = 40, 74 | ["Alta St"] = 40, 75 | ["Integrity Way"] = 30, 76 | ["Swiss St"] = 30, 77 | ["Strawberry Ave"] = 40, 78 | ["Capital Blvd"] = 30, 79 | ["Crusade Rd"] = 30, 80 | ["Innocence Blvd"] = 40, 81 | ["Davis Ave"] = 40, 82 | ["Little Bighorn Ave"] = 35, 83 | ["Roy Lowenstein Blvd"] = 35, 84 | ["Jamestown St"] = 30, 85 | ["Carson Ave"] = 35, 86 | ["Grove St"] = 30, 87 | ["Brouge Ave"] = 30, 88 | ["Covenant Ave"] = 30, 89 | ["Dutch London St"] = 40, 90 | ["Signal St"] = 30, 91 | ["Elysian Fields Fwy"] = 75, 92 | ["Plaice Pl"] = 30, 93 | ["Chum St"] = 40, 94 | ["Chupacabra St"] = 30, 95 | ["Miriam Turner Overpass"] = 30, 96 | ["Autopia Pkwy"] = 35, 97 | ["Exceptionalists Way"] = 35, 98 | ["La Puerta Fwy"] = 75, 99 | ["New Empire Way"] = 30, 100 | ["Runway1"] = "--", 101 | ["Greenwich Pkwy"] = 35, 102 | ["Kortz Dr"] = 30, 103 | ["Banham Canyon Dr"] = 40, 104 | ["Buen Vino Rd"] = 40, 105 | ["Route 68"] = 65, 106 | ["Zancudo Grande Valley"] = 40, 107 | ["Zancudo Barranca"] = 40, 108 | ["Galileo Rd"] = 40, 109 | ["Mt Vinewood Dr"] = 40, 110 | ["Marlowe Dr"] = 40, 111 | ["Milton Rd"] = 35, 112 | ["Kimble Hill Dr"] = 35, 113 | ["Normandy Dr"] = 35, 114 | ["Hillcrest Ave"] = 35, 115 | ["Hillcrest Ridge Access Rd"] = 35, 116 | ["North Sheldon Ave"] = 35, 117 | ["Lake Vinewood Dr"] = 35, 118 | ["Lake Vinewood Est"] = 35, 119 | ["Baytree Canyon Rd"] = 40, 120 | ["North Conker Ave"] = 35, 121 | ["Wild Oats Dr"] = 35, 122 | ["Whispymound Dr"] = 35, 123 | ["Didion Dr"] = 35, 124 | ["Cox Way"] = 35, 125 | ["Picture Perfect Drive"] = 35, 126 | ["South Mo Milton Dr"] = 35, 127 | ["Cockingend Dr"] = 35, 128 | ["Mad Wayne Thunder Dr"] = 35, 129 | ["Hangman Ave"] = 35, 130 | ["Dunstable Ln"] = 35, 131 | ["Dunstable Dr"] = 35, 132 | ["Greenwich Way"] = 35, 133 | ["Greenwich Pl"] = 35, 134 | ["Hardy Way"] = 35, 135 | ["Richman St"] = 35, 136 | ["Ace Jones Dr"] = 35, 137 | ["Los Santos Freeway"] = 65, 138 | ["Senora Rd"] = 40, 139 | ["Nowhere Rd"] = 25, 140 | ["Smoke Tree Rd"] = 35, 141 | ["Cholla Rd"] = 35, 142 | ["Cat-Claw Ave"] = 35, 143 | ["Senora Way"] = 40, 144 | ["Palomino Fwy"] = 75, 145 | ["Shank St"] = 25, 146 | ["Macdonald St"] = 35, 147 | ["Route 68 Approach"] = 65, 148 | ["Vinewood Park Dr"] = 35, 149 | ["Vinewood Blvd"] = 40, 150 | ["Mirror Park Blvd"] = 35, 151 | ["Glory Way"] = 35, 152 | ["Bridge St"] = 35, 153 | ["West Mirror Drive"] = 35, 154 | ["Nikola Ave"] = 35, 155 | ["East Mirror Dr"] = 35, 156 | ["Nikola Pl"] = 25, 157 | ["Mirror Pl"] = 35, 158 | ["El Rancho Blvd"] = 40, 159 | ["Olympic Fwy"] = 75, 160 | ["Fudge Ln"] = 25, 161 | ["Amarillo Vista"] = 25, 162 | ["Labor Pl"] = 35, 163 | ["El Burro Blvd"] = 35, 164 | ["Sustancia Rd"] = 45, 165 | ["South Shambles St"] = 30, 166 | ["Hanger Way"] = 30, 167 | ["Orchardville Ave"] = 30, 168 | ["Popular St"] = 40, 169 | ["Buccaneer Way"] = 45, 170 | ["Abattoir Ave"] = 35, 171 | ["Voodoo Place"] = 30, 172 | ["Mutiny Rd"] = 35, 173 | ["South Arsenal St"] = 35, 174 | ["Forum Dr"] = 35, 175 | ["Morningwood Blvd"] = 35, 176 | ["Dorset Dr"] = 40, 177 | ["Caesars Place"] = 25, 178 | ["Spanish Ave"] = 30, 179 | ["Portola Dr"] = 30, 180 | ["Edwood Way"] = 25, 181 | ["San Vitus Blvd"] = 40, 182 | ["Eclipse Blvd"] = 35, 183 | ["Gentry Lane"] = 30, 184 | ["Las Lagunas Blvd"] = 40, 185 | ["Power St"] = 40, 186 | ["Mt Haan Rd"] = 40, 187 | ["Elgin Ave"] = 40, 188 | ["Hawick Ave"] = 35, 189 | ["Meteor St"] = 30, 190 | ["Alta Pl"] = 30, 191 | ["Occupation Ave"] = 35, 192 | ["Carcer Way"] = 40, 193 | ["Eastbourne Way"] = 30, 194 | ["Rockford Dr"] = 35, 195 | ["Abe Milton Pkwy"] = 35, 196 | ["Laguna Pl"] = 30, 197 | ["Sinners Passage"] = 30, 198 | ["Atlee St"] = 30, 199 | ["Sinner St"] = 30, 200 | ["Supply St"] = 30, 201 | ["Amarillo Way"] = 35, 202 | ["Tower Way"] = 35, 203 | ["Decker St"] = 35, 204 | ["Tackle St"] = 25, 205 | ["Low Power St"] = 35, 206 | ["Clinton Ave"] = 35, 207 | ["Fenwell Pl"] = 35, 208 | ["Utopia Gardens"] = 25, 209 | ["Cavalry Blvd"] = 35, 210 | ["South Boulevard Del Perro"] = 35, 211 | ["Americano Way"] = 25, 212 | ["Sam Austin Dr"] = 25, 213 | ["East Galileo Ave"] = 35, 214 | ["Galileo Park"] = 35, 215 | ["West Galileo Ave"] = 35, 216 | ["Tongva Dr"] = 40, 217 | ["Zancudo Rd"] = 35, 218 | ["Movie Star Way"] = 35, 219 | ["Heritage Way"] = 35, 220 | ["Perth St"] = 25, 221 | ["Chianski Passage"] = 30, 222 | ["Lolita Ave"] = 35, 223 | ["Meringue Ln"] = 35, 224 | ["Fantastic Pl"] = 35, 225 | ["Steele Way"] = 35, 226 | ["Mt Haan Dr"] = 35, 227 | ["Peaceful St"] = 35, 228 | ["Strangeways Dr"] = 35, 229 | ["York St"] = 35, 230 | ["Tangerine St"] = 35, 231 | ["North Archer Ave"] = 35, 232 | ["Dry Dock St"] = 35 233 | } -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'bodacious' 2 | 3 | game 'gta5' 4 | 5 | version 'v2.1' 6 | 7 | Author 'Free World Scripts' 8 | 9 | client_scripts { 10 | 'config.lua', 11 | 'nui.lua' 12 | } 13 | 14 | ui_page 'html/index.html' 15 | 16 | files { 17 | 'html/index.css', 18 | 'html/index.js', 19 | 'html/index.html', 20 | 'html/sign.png' 21 | } -------------------------------------------------------------------------------- /html/eusign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Free-World-Scripts/FWSspeedlimit/e970c4a3f4d6527691b802cdd833003305a88988/html/eusign.png -------------------------------------------------------------------------------- /html/index.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Sawarabi+Gothic&display=swap'); 2 | 3 | body { 4 | overflow-y: hidden; /* Hide vertical scrollbar */ 5 | overflow-x: hidden; /* Hide horizontal scrollbar */ 6 | font-family: 7 | 'system-ui', 8 | 'Segoe UI', 9 | 'Sawarabi Gothic', 10 | 'Helvetica', 11 | 'Arial', 12 | 'sans-serif', 13 | 'Apple Color Emoji', 14 | 'Segoe UI Emoji'; 15 | } 16 | 17 | .m1l-2-c { 18 | font-size: 25; 19 | position: relative; 20 | top: 90.5vh; 21 | left: 14.5vh; 22 | } 23 | .m1l-2 { 24 | top: 91vh; 25 | position: relative; 26 | left: 18.25vh; 27 | } -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /html/index.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $( "#all" ).draggable(); 3 | window.addEventListener("message", function(event){ 4 | var item = event.data; 5 | $('#Speed').text(`${item.Speed}`); 6 | if(item.Display){ 7 | $('#all').fadeOut() 8 | 9 | }else{ 10 | $('#all').fadeIn() 11 | } 12 | }) 13 | 14 | }) 15 | var sPositions = localStorage.positions || "{}", 16 | positions = JSON.parse(sPositions); 17 | $.each(positions, function (id, pos) { 18 | $("#" + id).css(pos) 19 | }) 20 | $("#all").draggable({ 21 | containment: "#containment-wrapper", 22 | scroll: false, 23 | stop: function (event, ui) { 24 | positions[this.id] = ui.position 25 | localStorage.positions = JSON.stringify(positions) 26 | } 27 | }); 28 | document.onkeyup = function (data) { 29 | if (data.which == 27) { 30 | $.post('http://speedlimit/exit', JSON.stringify({})); 31 | return 32 | } 33 | }; -------------------------------------------------------------------------------- /html/sign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Free-World-Scripts/FWSspeedlimit/e970c4a3f4d6527691b802cdd833003305a88988/html/sign.png -------------------------------------------------------------------------------- /nui.lua: -------------------------------------------------------------------------------- 1 | local speedlimit = "N/A" 2 | local dis = true 3 | local currentspeed = 0 4 | 5 | Citizen.CreateThread(function() 6 | while true do 7 | local iPed = GetPlayerPed(-1) 8 | Citizen.Wait(1000) 9 | local playerloc = GetEntityCoords(iPed) 10 | local streethash = GetStreetNameAtCoord(playerloc.x, playerloc.y, playerloc.z) 11 | street = GetStreetNameFromHashKey(streethash) 12 | if IsPedInAnyPlane(iPed) == 1 then 13 | dis = true 14 | SendNUIMessage({ 15 | Speed = "", 16 | Display = dis 17 | }) 18 | elseif IsPedInAnyHeli(iPed) == 1 then 19 | dis = true 20 | SendNUIMessage({ 21 | Speed = "", 22 | Display = dis 23 | }) 24 | elseif IsPedInAnyBoat(iPed) == 1 then 25 | dis = true 26 | SendNUIMessage({ 27 | Speed = "", 28 | Display = dis 29 | }) 30 | elseif IsPedInAnyVehicle(iPed) == 1 then 31 | dis = false 32 | if currentspeed ~= Config.Speedlimits[street] then 33 | SendNUIMessage({ 34 | Speed = speedlimit, 35 | Display = dis 36 | }) 37 | if Config.Speed == 'mph' then 38 | if Config.Speedlimits[street] then 39 | speedlimit = Config.Speedlimits[street] 40 | else 41 | speedlimit = "N/A" 42 | end 43 | elseif Config.Speed == 'kph' then 44 | if Config.Speedlimits[street] then 45 | speedlimit = math.floor(Config.Speedlimits[street] * 1.609) 46 | else 47 | speedlimit = "N/A" 48 | end 49 | else 50 | if Config.Speedlimits[street] then 51 | speedlimit = Config.Speedlimits[street] 52 | else 53 | speedlimit = "N/A" 54 | end 55 | end 56 | end 57 | else 58 | dis = true 59 | SendNUIMessage({ 60 | Speed = "", 61 | Display = dis 62 | }) 63 | end 64 | end 65 | end) 66 | 67 | RegisterNetEvent("hud:speed") 68 | AddEventHandler("hud:speed", function(toggled) 69 | local size 70 | local height 71 | local iPed = GetPlayerPed(-1) 72 | if IsPedInAnyVehicle(iPed) then 73 | size = tonumber(toggled) 74 | size = size/10 75 | height = size*2 76 | SendNUIMessage({ 77 | width = size, 78 | height = height 79 | }) 80 | end 81 | end) 82 | 83 | RegisterCommand(Config.Command, function(source, args) 84 | local iPed = GetPlayerPed(-1) 85 | local mspeed = false 86 | if IsPedInAnyVehicle(iPed) then 87 | mspeed = not mspeed 88 | SetNuiFocus(mspeed, mspeed) 89 | end 90 | end) 91 | 92 | Citizen.CreateThread(function() 93 | while mspeed do 94 | Citizen.Wait(0) 95 | DisableControlAction(0, 1, display) -- LookLeftRight 96 | DisableControlAction(0, 2, display) -- LookUpDown 97 | DisableControlAction(0, 142, display) -- MeleeAttackAlternate 98 | DisableControlAction(0, 18, display) -- Enter 99 | DisableControlAction(0, 322, display) -- ESC 100 | DisableControlAction(0, 106, display) -- VehicleMouseControlOverride 101 | end 102 | end) 103 | 104 | RegisterNUICallback("exit", function(data) 105 | local iPed = GetPlayerPed(-1) 106 | if IsPedInAnyVehicle(iPed) then 107 | mspeed = false 108 | SetNuiFocus(mspeed, mspeed) 109 | end 110 | end) --------------------------------------------------------------------------------