[Release] Speedlimits

Speedlimits

Showcase

Preiview video (Youtube)

About

Speedlimits is a free and standalone script that shows lore-friendly speed limits on customizable nui signs. The script’s usage of vehicle nodes allows the speed limits to be much more accurate than other scripts. For example, it allows for multiple speed limits on the same street as well as advisory/recommended speed signs. Furthermore, you can add custom signs or use any of the signs that already come with the script (See Configuration).

*By default, the speed limits are based on in-game signs, NPC speeds, and the road’s real-life counterparts. (you can of course change them to whatever you like)

This resource was initially inspired by [FREE] On-Screen NUI Speedlimit Signs made by @Sinatra_99.

Optimization
The script runs at 0.00ms when you’re not in a vehicle. It uses between 0.01ms to 0.03ms when it’s active.

Configuration
The script can be configured to your liking.

config.lua
Config = {}

-- Whether or not it is enabled by default (if false people have to use the /speedlimit command to enable it)
Config.Enabled = true

-- The type of sign and advisory sign to use (see the bottom of this file for a list of possible signs)
Config.SignType = 'us-standard'
Config.AdvisoryType = 'us-advisory' -- or false (no quotes) to disable

-- If set to true, only the driver of the vehicle will be able to see the speedlimit
Config.DriverOnly = false

-- If set to true, it will only display the speedlimit for x amount of time when it changes before it fades away
Config.DisplayOnlyOnChange = false
Config.ChangeDisplayTime = 3000 -- ms the speedlimit should be displayed after change if Config.DisplayOnlyOnChange is set to true

-- Speedlimits for certain areas. NOTE: Not every road draws it speed limit from these.
Config.Speedlimits = {
    Default = 35,
    DirtRoads = 35, -- Most, but not all dirt roads
    PaletoBay = 35,
    SandyShores = 35,
    Freeway = 60
}

-- Localization for the notifications
Config.Localization = {
    ShowSpeedlimit = "The speedlimit is now shown!",
    HideSpeedlimit = "The speedlimit is now hidden!"
}

-- Blacklisted vehicle classes
--[[
13: Cycles
14: Boats
15: Helicopters
16: Planes
]]--
Config.BlacklistedClasses = {
    [13] = true, [14] = true, [15] = true, [16] = true
}

--[[
List of possible signs.
Regular Speedlimit Signs:
us-standard
us-oregon
us-metric
canada-standard
canada-ontario
canada-yt-bc (Yukon and British Columbia)
germany
japan
united-kingdom
amber (Sweden, Finland, Iceland etc.)
australia
Advisory/Recomended Speedlimit Signs:
us-advisory
eu-advisory
sweden-advisory
uk-advisory
]]--

You can also see the config file on GitHub.

Custom Signs
There are 15 different signs included with the script. They are not guaranteed to work 100% as the script was originally made to only work with regular US signs. You can also add custom signs and fonts yourself.

Custom Sign Position/Size
You can freely change the position and size in the CSS file. Here is an example of how you could put it inside the minimap:

CSS
/* These should replace their counterparts that already exist in the CSS file */
#container {
	display: none;
	position: absolute;
	left: 4vh;
    bottom: 4vh;
}

#background {
	background-repeat: no-repeat;
	background-size: cover;
	height: 3rem;
	width: 3rem;
}

.background-us-standard {
	background: url("images/us_standard.png");
}
.numerals-us-standard {
	color: rgb(35, 31, 32);
	font-size: 1.25rem;
	font-weight: bold;
	font-family: highwaygothic;
	padding-top: 1.55rem;
	transform:scale(1.1, 1);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
}
Image

small_sign

Images

Download

GitHub
Direct download: speedlimit.zip (386.1 KB)

Some of my other scripts
[Standalone] [Paid] Sit Anywhere
[Standalone] [PAID] Slash Tires
[Standalone] [Paid] CS Styled Killfeed
[Release] Telescopes
[Release] No Exploding Pumps
[Standalone] Crutches

10 Likes

nice work bro keep going

1 Like

@izmystic

really nice script, i will use ofc

Really nice.
Can you send me the .css file for the image you posted?
image

Right above where you found that image the CSS should be (inside the dropdown calls “CSS”).

But here is it:

/* These should replace their counterparts that already exist in the CSS file */
#container {
	display: none;
	position: absolute;
	left: 4vh;
    bottom: 4vh;
}

#background {
	background-repeat: no-repeat;
	background-size: cover;
	height: 3rem;
	width: 3rem;
}

.background-us-standard {
	background: url("images/us_standard.png");
}
.numerals-us-standard {
	color: rgb(35, 31, 32);
	font-size: 1.25rem;
	font-weight: bold;
	font-family: highwaygothic;
	padding-top: 1.55rem;
	transform:scale(1.1, 1);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
}

As the comment says, these should replace their counterparts that already exist in the CSS file.

1 Like

Amazing Release! Now using this in my server.

Thank you for that, but it still remains in the bottom right? What do I change to move it over the minimap like you have in the above pic?

I have the css for it being at the bottom right of the minimap if you would like it.

1 Like

You need to take the CSS that I posted in the previous comment of mine and put it inside the style.css file, and then remove the duplicate entries.

So the file should look like this in the end:

@font-face {
	font-family: highwaygothic;
	src: url('fonts/Highway-Gothic-Regular.ttf');
}

@font-face {
	font-family: din1451;
	src: url('fonts/DINMittelschriftStd.otf');
}

@font-face {
	font-family: transport;
	src: url('fonts/Transport-Medium.ttf');
}

#container {
	display: none;
	position: absolute;
	left: 4vh;
    bottom: 4vh;
}


/* Speedlimit */

#sign {
	display: none;
}

#background {
	background-repeat: no-repeat;
	background-size: cover;
	height: 3rem;
	width: 3rem;
}

#numerals {
	text-align: center;
	margin: 0;
}

/* United States */
.background-us-standard {
	background: url("images/us_standard.png");
}
.numerals-us-standard {
	color: rgb(35, 31, 32);
	font-size: 1.25rem;
	font-weight: bold;
	font-family: highwaygothic;
	padding-top: 1.55rem;
	transform:scale(1.1, 1);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
}

.background-us-oregon {
	background: url("images/us_oregon.png");
}
.numerals-us-oregon {
	padding-top: 2.5rem;
	color: rgb(0, 0, 0);
	font-size: 9rem;
	font-family: highwaygothic;
    transform:scale(0.80, 1);
}

.background-us-metric {
	background: url("images/us_metric.png");
}
.numerals-us-metric {
	padding-top: 5.42rem;
	color: rgb(0, 0, 0);
	font-size: 3rem;
	font-family: highwaygothic;
}

/* Canada */
.background-canada-standard {
	background: url("images/canada_standard.png");
}
.numerals-canada-standard {
	padding-top: 3.75rem;
	color: rgb(35, 31, 32);
	font-size: 6.5rem;
	font-family: highwaygothic;
}

.background-canada-ontario {
	background: url("images/canada_ontario.png");
}
.numerals-canada-ontario {
	padding-top: 3.25rem;
	color: rgb(0, 0, 0);
	font-size: 6rem;
	font-family: highwaygothic;
}

.background-canada-yt-bc {
	background: url("images/canada_yt_bc.png");
}
.numerals-canada-yt-bc {
	padding-top: 2rem;
	color: rgb(0, 0, 0);
	font-size: 7rem;
	font-family: Arial;
	font-weight: 600;
}

/* Germany */
.background-germany {
	background: url("images/germany.png");
}
.numerals-germany {
	padding-top: 2rem;
	color: rgb(0, 0, 0);
	font-size: 7rem;
	font-family: din1451;
}

.numerals-cramp-germany {
	padding-top: 2.5rem;
	font-size: 6rem;
	letter-spacing: -0.3rem;
	text-indent: -0.3rem;
}

/* Japan */
.background-japan {
	background: url("images/japan.png");
}
.numerals-japan {
	padding-top: 2.6rem;
	color: rgb(0, 102, 179);
	font-size: 6rem;
	font-family: Arial;
}

/* United Kingdom */
.background-united-kingdom {
	background: url("images/united_kingdom.png");
}
.numerals-united-kingdom {
	padding-top: 2.2rem;
	color: rgb(0, 0, 0);
	font-size: 6.5rem;
	font-family: transport;
    font-weight: bold;
}

/* Amber */
.background-amber {
	background: url("images/amber.png");
}
.numerals-amber {
	padding-top: 1.9rem;
	color: rgb(0, 0, 0);
	font-size: 7.25rem;
	font-family: Arial;
	font-weight: bold;
}

/* Australia */
.background-australia {
	background: url("images/australia.png");
}
.numerals-australia {
	padding-top: 3.2rem;
	color: rgb(0, 0, 0);
	font-size: 5.25rem;
	font-family: highwaygothic;
}


/* Advisory */

#advisory-sign {
	display: none;
}

#advisory-background {
	height: 3rem;
	width: 3rem;
	background-repeat: no-repeat;
	background-size: cover;
}

#advisory-numerals {
	text-align: center;
}

#advisory-label {
	text-align: center;
}


/* US */
.advisory-background-us-advisory {
	margin-bottom: 0.5vh;
	background: url("images/us_advisory.png");
}
.advisory-label-us-advisory {
	padding-top: 0.32rem;
	color: rgb(0, 0, 0);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
	transform:scale(1.20, 1);
	font-size: 0.5rem;
	font-weight: 600;
	font-family: highwaygothic;
}
.advisory-numerals-us-advisory {
	margin-top: -0.35rem;
	color: rgb(0, 0, 0);
	font-size: 1.2rem;
	font-weight: bold;
	font-family: highwaygothic;
	transform:scale(1.20, 1);
}

/* EU */
.advisory-background-eu-advisory {
	margin-bottom: 1vh;
	background: url("images/eu_advisory.png");
}
.advisory-label-eu-advisory {
	display: none;
}
.advisory-numerals-eu-advisory {
	padding-top: 2.75rem;
	color: rgb(255, 255, 255);
	font-size: 5.8rem;
	font-weight: bold;
	font-family: Arial;
}

/* Sweden */
.advisory-background-sweden-advisory {
	margin-bottom: 1vh;
	background: url("images/sweden_advisory.png");
}
.advisory-label-sweden-advisory {
	display: none;
}
.advisory-numerals-sweden-advisory {
	padding-top: 4rem;
	color: rgb(255, 255, 255);
	font-size: 3.7rem;
	font-weight: bold;
	font-family: Arial;
	letter-spacing: 0.75rem;
	text-indent: 0.75rem;
}

/* United Kingdom */
.advisory-background-uk-advisory {
	margin-bottom: 1vh;
	background: url("images/uk_advisory.png");
}
.advisory-label-uk-advisory {
	display: none;
}
.advisory-numerals-uk-advisory {
	padding-top: 7.45rem;
	margin-left: 5.55vh;
	color: rgb(0, 0, 0);
	font-size: 3.25rem;
	font-weight: bold;
	font-family: transport;
}

TLDR; Just copy the CSS above and replace the entire style.css file with that.

Edit: Changed the code above to include small advisory signs too.

1 Like

You can just pose it here, so people who want it in the bottom right of the minimap can use it. :+1:

I hate to be a bother but you forgot to do the US Advisory one, so that still appears super large. I’m really not sure what values to edit to fix it properly, sorry

All fine! I actually forgot about the advisory signs when I did the example for the one inside the minimap, so glad you asked!

Here is the CSS that needs to be added in.

.advisory-background-us-advisory {
	margin-bottom: 0.5vh;
	background: url("images/us_advisory.png");
}
.advisory-label-us-advisory {
	padding-top: 0.32rem;
	color: rgb(0, 0, 0);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
	transform:scale(1.20, 1);
	font-size: 0.5rem;
	font-weight: 600;
	font-family: highwaygothic;
}
.advisory-numerals-us-advisory {
	margin-top: -0.35rem;
	color: rgb(0, 0, 0);
	font-size: 1.2rem;
	font-weight: bold;
	font-family: highwaygothic;
	transform:scale(1.20, 1);
}

And here is the entire file if you are feeling too lazy to add it in manually:

style.css
@font-face {
	font-family: highwaygothic;
	src: url('fonts/Highway-Gothic-Regular.ttf');
}

@font-face {
	font-family: din1451;
	src: url('fonts/DINMittelschriftStd.otf');
}

@font-face {
	font-family: transport;
	src: url('fonts/Transport-Medium.ttf');
}

#container {
	display: none;
	position: absolute;
	left: 4vh;
    bottom: 4vh;
}


/* Speedlimit */

#sign {
	display: none;
}

#background {
	background-repeat: no-repeat;
	background-size: cover;
	height: 3rem;
	width: 3rem;
}

#numerals {
	text-align: center;
	margin: 0;
}

/* United States */
.background-us-standard {
	background: url("images/us_standard.png");
}
.numerals-us-standard {
	color: rgb(35, 31, 32);
	font-size: 1.25rem;
	font-weight: bold;
	font-family: highwaygothic;
	padding-top: 1.55rem;
	transform:scale(1.1, 1);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
}

.background-us-oregon {
	background: url("images/us_oregon.png");
}
.numerals-us-oregon {
	padding-top: 2.5rem;
	color: rgb(0, 0, 0);
	font-size: 9rem;
	font-family: highwaygothic;
    transform:scale(0.80, 1);
}

.background-us-metric {
	background: url("images/us_metric.png");
}
.numerals-us-metric {
	padding-top: 5.42rem;
	color: rgb(0, 0, 0);
	font-size: 3rem;
	font-family: highwaygothic;
}

/* Canada */
.background-canada-standard {
	background: url("images/canada_standard.png");
}
.numerals-canada-standard {
	padding-top: 3.75rem;
	color: rgb(35, 31, 32);
	font-size: 6.5rem;
	font-family: highwaygothic;
}

.background-canada-ontario {
	background: url("images/canada_ontario.png");
}
.numerals-canada-ontario {
	padding-top: 3.25rem;
	color: rgb(0, 0, 0);
	font-size: 6rem;
	font-family: highwaygothic;
}

.background-canada-yt-bc {
	background: url("images/canada_yt_bc.png");
}
.numerals-canada-yt-bc {
	padding-top: 2rem;
	color: rgb(0, 0, 0);
	font-size: 7rem;
	font-family: Arial;
	font-weight: 600;
}

/* Germany */
.background-germany {
	background: url("images/germany.png");
}
.numerals-germany {
	padding-top: 2rem;
	color: rgb(0, 0, 0);
	font-size: 7rem;
	font-family: din1451;
}

.numerals-cramp-germany {
	padding-top: 2.5rem;
	font-size: 6rem;
	letter-spacing: -0.3rem;
	text-indent: -0.3rem;
}

/* Japan */
.background-japan {
	background: url("images/japan.png");
}
.numerals-japan {
	padding-top: 2.6rem;
	color: rgb(0, 102, 179);
	font-size: 6rem;
	font-family: Arial;
}

/* United Kingdom */
.background-united-kingdom {
	background: url("images/united_kingdom.png");
}
.numerals-united-kingdom {
	padding-top: 2.2rem;
	color: rgb(0, 0, 0);
	font-size: 6.5rem;
	font-family: transport;
    font-weight: bold;
}

/* Amber */
.background-amber {
	background: url("images/amber.png");
}
.numerals-amber {
	padding-top: 1.9rem;
	color: rgb(0, 0, 0);
	font-size: 7.25rem;
	font-family: Arial;
	font-weight: bold;
}

/* Australia */
.background-australia {
	background: url("images/australia.png");
}
.numerals-australia {
	padding-top: 3.2rem;
	color: rgb(0, 0, 0);
	font-size: 5.25rem;
	font-family: highwaygothic;
}


/* Advisory */

#advisory-sign {
	display: none;
}

#advisory-background {
	height: 3rem;
	width: 3rem;
	background-repeat: no-repeat;
	background-size: cover;
}

#advisory-numerals {
	text-align: center;
}

#advisory-label {
	text-align: center;
}


/* US */
.advisory-background-us-advisory {
	margin-bottom: 0.5vh;
	background: url("images/us_advisory.png");
}
.advisory-label-us-advisory {
	padding-top: 0.32rem;
	color: rgb(0, 0, 0);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
	transform:scale(1.20, 1);
	font-size: 0.5rem;
	font-weight: 600;
	font-family: highwaygothic;
}
.advisory-numerals-us-advisory {
	margin-top: -0.35rem;
	color: rgb(0, 0, 0);
	font-size: 1.2rem;
	font-weight: bold;
	font-family: highwaygothic;
	transform:scale(1.20, 1);
}

/* EU */
.advisory-background-eu-advisory {
	margin-bottom: 1vh;
	background: url("images/eu_advisory.png");
}
.advisory-label-eu-advisory {
	display: none;
}
.advisory-numerals-eu-advisory {
	padding-top: 2.75rem;
	color: rgb(255, 255, 255);
	font-size: 5.8rem;
	font-weight: bold;
	font-family: Arial;
}

/* Sweden */
.advisory-background-sweden-advisory {
	margin-bottom: 1vh;
	background: url("images/sweden_advisory.png");
}
.advisory-label-sweden-advisory {
	display: none;
}
.advisory-numerals-sweden-advisory {
	padding-top: 4rem;
	color: rgb(255, 255, 255);
	font-size: 3.7rem;
	font-weight: bold;
	font-family: Arial;
	letter-spacing: 0.75rem;
	text-indent: 0.75rem;
}

/* United Kingdom */
.advisory-background-uk-advisory {
	margin-bottom: 1vh;
	background: url("images/uk_advisory.png");
}
.advisory-label-uk-advisory {
	display: none;
}
.advisory-numerals-uk-advisory {
	padding-top: 7.45rem;
	margin-left: 5.55vh;
	color: rgb(0, 0, 0);
	font-size: 3.25rem;
	font-weight: bold;
	font-family: transport;
}

small_sign_2

2 Likes

Right side version: (only affects us standard version)

@font-face {
	font-family: highwaygothic;
	src: url('fonts/Highway-Gothic-Regular.ttf');
}

@font-face {
	font-family: din1451;
	src: url('fonts/DINMittelschriftStd.otf');
}

@font-face {
	font-family: transport;
	src: url('fonts/Transport-Medium.ttf');
}

#container {
	display: none;
	position: absolute;
	right: 151vh;
    bottom: 4vh;
}


/* Speedlimit */

#sign {
	display: none;
}

#background {
	background-repeat: no-repeat;
	background-size: cover;
	height: 3.5rem;
	width: 3.5rem;
}

#numerals {
	text-align: center;
	margin: 0;
}

/* United States */
.background-us-standard {
	background: url("images/us_standard.png");
}
.numerals-us-standard {
	color: rgb(0, 0, 0);
	font-size: 1.25rem;
	font-weight: bold;
	font-family: highwaygothic;
	padding-top: 1.85rem;
	transform:scale(1.1, 1);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
}

/* Advisory */

#advisory-sign {
	display: none;
}

#advisory-background {
	height: 3.5rem;
	width: 3.5rem;
	background-repeat: no-repeat;
	background-size: cover;
}

#advisory-numerals {
	text-align: center;
}

#advisory-label {
	text-align: center;
}


/* US */
.advisory-background-us-advisory {
	margin-bottom: 1vh;
	background: url("images/us_advisory.png");
}
.advisory-label-us-advisory {
	padding-top: 0.25rem;
	color: rgb(0, 0, 0);
	letter-spacing: 0.1rem;
	text-indent: 0.1rem;
	transform:scale(1.15, 1);
	font-size: 0.75rem;
	font-weight: 600;
	font-family: highwaygothic;
}
.advisory-numerals-us-advisory {
	margin-top: -0.5rem;
	color: rgb(0, 0, 0);
	font-size: 1.2rem;
	font-weight: bold;
	font-family: highwaygothic;
	transform:scale(1.20, 1);
}

image

(edited for text placement fixes)

1 Like

is there a way to move it to the left side of the screen? in the middle right under the OCC chat

You’ll have to change #container inside style.css.

Is it possible to add or change certain road speedlimits?

Hello!

Yes, you can change any road’s speed limit. If you want to change general speed limits, go to the config file and change the different limits inside Config.Speedlimits.

If you want to change the speed limit on a specific road then you’ll have to go into speedlimits.lua file and find the road there (search by name or hash), and then change the limit parameter.