[Release] Simple Speedometer

I’ve made a simple speedometer just to test the NUI stuff. This works, so I thought why not release it?

You can switch between MPH and KM/H mode with F6 (aka “Quick Switch To Franklin” key).

This comes in black and white outline versions (I couldn’t decide on either one).

Download:

Black Outline

White Outline

8 Likes

Awesome job! Have you ever thought about releasing a script for a police radar, I think it would be ideal for role play servers since SHVdotNet is disabled now. Appreciate you work as always!

Austin

Thank you for your continued work and releasing scripts for the community, this is def a keeper.

How do I install this to my server? Is it client side also?

1 Like

Anyway we can change the font?

Yeah, place your font in the resource, add it to the __resource.lua and then edit the .css.

Thanks a lot for your scripts!

I’ve made a version of your speedometer to learn how it works.
Maybe someone would be interested so I put it here:
gui_speedometer.7z (14.9 KB)


I’ve changed a few things:

  • it appears a bit higher on the screen to allow space for vehicles and streets names
  • speeds are displayed both in MPH and KM/H.
    If you want the speed in MPH to be the biggest number, you can switch the following values in client.lua:
SendNUIMessage({
	showhud = true,

	unitLine1 = "KM/H",		-- Change this to: unitLine1 = "MPH",
	speedLine1 = speedKmh,		-- Change this to: speedLine1 = speedMph,
	unitLine2 = "MPH",		-- Change this to: unitLine2 = "KM/H",
	speedLine2 = speedMph		-- Change this to: speedLine2 = speedKmh,
})

I didn’t try it on another computer, so I hope it will not be screwed up if you use a different resolution (my game uses 1920*1080).

9 Likes

Tested it, works good. Nice job.

nice design, thanks for sharing :smiley:

Any chance you might know of a way to hide the street/vehicle names other than in the options menu? I would like to have it turned off for the server.

hello guys
i’m trying to figure out how to create a car repairer job but i cant find anything that can help me or something aldready create? and on the same topic our personnal car keep despawning as soon as you leave them and same didn’t find something about it !
If someone can help me on this it could be nice !
Thank you

Sorry english isnt my native language

Gxt2 files should be streaming compatible.
Streets names should be in global.gxt2 (I didn’t check this) so you can try to remove the names from this file and to stream it to your clients.

anyways to move the location of the speedo ?

You need to edit the CSS file.
There is 5 blocks to edit:

#speedcontainer {
...
	bottom: 150px;
	right: 45px;
}

.speedLine1 {
...
	bottom: 60px;
	right: 75px;
...
}
.unitLine1 {
...
	bottom: 114px;
	right: 1px;
...
}

.speedLine2 {
...
	bottom: 9px;
	right: 63px;
...
}
.unitLine2 {
...
	bottom: 14px;
	right: 1px;
...
}

The speedometer is placed from the bottom right corner.
You need to move the background and each lines (“km/h”, “mph”, …) so I suggest you move the #speedcontainer (background) and then add the amount you added (right & bottom) to each elements.

2 Likes

oh thats easy , thanks :smiley:

I can’t get this working on the latest FXServer.

do you still have this link is broken? also does it work with fx?

The link works well for me, try Right clicking -> Save target as and be sure you have 7zip installed to unzip the archive :wink:
I haven’t tried it on fxserver though.

I cannot right click it i get this


and if i click on it i get this

You need to choose Save link as...