[RELEASE] Simple Speedom

Hello guys

Today i decided to post Simple Speedometer edited by the default odometer version that is not working Original not working, enjoy!

Note
This doesn’t include the seatbelt because it is not made by me :slight_smile:

Made by me working
Download

Original Creator

Ideea to edit that is provided by NiPsEeN , i just applied the ideea <3

speedo

11 Likes

Well you could at least link the original scripts :smiley:

forgot <3

nice =))

=)) (charac)

what?=))

love this

This script is inspired from mine, not a problem with that, but add some credits there…

I am speaking about the design and the status of the car!!!

If you don’t believe me, just check my odometer script ( not optimized )!!!

There are credits :slight_smile:

Then thanks!

Is it possible to move the the hud like left of the map?

normally

Everything is possible with CSS… depends though if it can’t fit beside the map… play with the sizes :slight_smile:

Well, that’s not CSS :slight_smile:

It is native game design, just check the natives and there u go!!!

How would i go around setting up the seat belt aspect of this script

How would I make the unlock and lock function work

RegisterNetEvent('get_benzina')
AddEventHandler('get_benzina', function(benzina)
end)

function onScreen(content,x,y)
        SetTextFont(4)
        SetTextProportional(0)
        SetTextScale(0.5, 0.5)
        SetTextEntry("STRING")
        AddTextComponentString(content)
        DrawText(x+0.005, y-0.058)
        DrawRect(x+0.05, y-0.01, 0.100, 0.093,0,0,0,100)
        DrawRect(x, y-0.01, 0.0025, 0.094,255,30,30,255)
end

function round(n)
    return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
end

function lock()
  if(IsPedInAnyVehicle(GetPlayerPed(-1), false)) then
    if IsControlJustPressed(1,303) then
      veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)
      local locked = GetVehicleDoorLockStatus(veh) >= 2
      if locked then -- unlock
        SetVehicleDoorsLockedForAllPlayers(veh, false)
        SetVehicleDoorsLocked(veh,1)
        SetVehicleDoorsLockedForPlayer(veh, PlayerId(), false)
        TriggerEvent("pNotify:SendNotification", {text = "Ai descuiat masina!", type = "success", timeout = 1400, layout = "bottomRight"})
      else -- lock
        SetVehicleDoorsLocked(veh,2)
        SetVehicleDoorsLockedForAllPlayers(veh, true)
        TriggerEvent("pNotify:SendNotification", {text = "Ai incuiat masina!", type = "success", timeout = 1400, layout = "bottomRight"})
      end
    end
  else 
    if IsControlJustPressed(1,303) then
      veh =  GetVehiclePedIsIn(GetPlayerPed(-1), true)
      
      local locked = GetVehicleDoorLockStatus(veh) >= 2
      if locked then -- unlock
        SetVehicleDoorsLockedForAllPlayers(veh, false)
        SetVehicleDoorsLocked(veh,1)
        SetVehicleDoorsLockedForPlayer(veh, PlayerId(), false)
        TriggerEvent("pNotify:SendNotification", {text = "Ai descuiat masina!", type = "success", timeout = 1400, layout = "bottomRight"})
      else -- lock
        SetVehicleDoorsLocked(veh,2)
        SetVehicleDoorsLockedForAllPlayers(veh, true)
        TriggerEvent("pNotify:SendNotification", {text = "Ai incuiat masina!", type = "success", timeout = 1400, layout = "bottomRight"})
      end
    end
  end
end

Citizen.CreateThread(function()
  while true do
        Citizen.Wait(0)
        player = GetPlayerPed(-1)
        lock()
        if(IsPedInAnyVehicle(GetPlayerPed(-1), false)) then
            local spd = round(GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false))*2.236936)
            plate = GetVehicleNumberPlateText(GetVehiclePedIsIn(GetPlayerPed(-1), false))
            local fuel    = math.ceil(round(GetVehicleFuelLevel(GetVehiclePedIsIn(GetPlayerPed(-1), false)), 1))
            local veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)
            if GetVehicleDoorLockStatus(veh) >= 2 then
                status = "Locked"
            else
                status = "Unlocked"
            end
            if fuel < 1 then
              tfuel = "0 %"
            else
              tfuel = fuel.." %"
            end
            onScreen("~r~Speed ~w~"..spd.." MP/H \n".."~r~Status ~w~"..status.."\n~r~Fuel ~w~"..tostring(tfuel), 0.9,0.8)
        end
    end
end)

function notify(msg)
    SetNotificationTextEntry("STRING")
    AddTextComponentString(msg)
    DrawNotification(true, false)
  end

Blockquote