File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
FiveM - Creating a Speedometer Using Conditionals and Math/speedometer Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
- local mph = true
2
1
3
- if mph == true then
4
- local factor = 2.2369
5
- else
6
- local factor = 3.6
7
- end
8
2
--[[
9
3
local mph = 2.2369
10
4
local kph = 3.6
@@ -16,16 +10,16 @@ function text(content)
16
10
SetTextScale (1.9 ,1.9 )
17
11
SetTextEntry (" STRING" )
18
12
AddTextComponentString (content )
19
- DrawText (0.9 ,0.5 )
13
+ DrawText (0.9 ,0.7 )
20
14
end
21
15
Citizen .CreateThread (function ()
22
16
23
17
while true do
24
18
Citizen .Wait (1 )
25
- local speed = (GetEntitySpeed (GetVehiclePedIsIn (GetPlayerPed (- 1 ), false ))* factor )
19
+ local speed = (GetEntitySpeed (GetVehiclePedIsIn (GetPlayerPed (- 1 ), false ))* 2.2369 )
26
20
-- Condition to check if the ped is in a vehicle
27
21
if (IsPedInAnyVehicle (GetPlayerPed (- 1 ), false )) then
28
22
text (math.floor (speed ))
29
23
end
30
24
end
31
- end )
25
+ end )
You can’t perform that action at this time.
0 commit comments