lua system time code
-
Is this correct? Modified the code for it to show local time instead of game world time.
function ExtraHUD.ShowTime()
Hour = TIME.GET_LOCAL_TIME(hour)
Minute = TIME.GET_LOCAL_TIME(minute)
if Minute < 10 then
Minute = string.format("0%d", Minute)
end
if ampmclock == true then
AMPM = "AM"
if Hour == 00 then
Hour = string.format("12")
elseif Hour < 10 then
Hour = string.format("0%d", Hour)
elseif Hour >= 12 then
AMPM = "PM"
if Hour > 12 then
Hour = math.floor(Hour - 12)
if Hour < 10 then
Hour = string.format("0%d", Hour)
end
end
end
Time = string.format("%s:%s %s", Hour, Minute, AMPM)
else
if Hour < 10 then
Hour = string.format("0%d", Hour)
end
Time = string.format("%s:%s", Hour, Minute)
end
DrawText(Time, extrahudy - 0.140, extrahudx, 0.45)
end
-
This post is deleted!