Skip to content

Commit 3c62721

Browse files
authored
fix
1 parent 2c235ab commit 3c62721

File tree

1 file changed

+3
-9
lines changed
  • FiveM - Creating a Speedometer Using Conditionals and Math/speedometer

1 file changed

+3
-9
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
local mph = true
21

3-
if mph == true then
4-
local factor = 2.2369
5-
else
6-
local factor = 3.6
7-
end
82
--[[
93
local mph = 2.2369
104
local kph = 3.6
@@ -16,16 +10,16 @@ function text(content)
1610
SetTextScale(1.9,1.9)
1711
SetTextEntry("STRING")
1812
AddTextComponentString(content)
19-
DrawText(0.9,0.5)
13+
DrawText(0.9,0.7)
2014
end
2115
Citizen.CreateThread(function()
2216

2317
while true do
2418
Citizen.Wait(1)
25-
local speed = (GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false))*factor)
19+
local speed = (GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false))*2.2369)
2620
-- Condition to check if the ped is in a vehicle
2721
if(IsPedInAnyVehicle(GetPlayerPed(-1), false)) then
2822
text(math.floor(speed))
2923
end
3024
end
31-
end)
25+
end)

0 commit comments

Comments
 (0)