-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathshared.lua
80 lines (74 loc) · 1.24 KB
/
shared.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
GTAVWeatherTypes = {
"blizzard",
"clear",
"clearing",
"clouds",
"extrasunny",
"foggy",
"halloween",
"neutral",
"overcast",
"rain",
"smog",
"snow",
"snowlight",
"thunder",
"xmas"
}
RDR2WeatherTypes = {
"blizzard",
"clouds",
"drizzle",
"fog",
"groundblizzard",
"hail",
"highpressure",
"hurricane",
"misty",
"overcast",
"overcastdark",
"rain",
"sandstorm",
"shower",
"sleet",
"snow",
"snowlight",
"sunny",
"thunder",
"thunderstorm",
"whiteout"
}
function TimeToDHMS(time)
local day = math.floor(time / 86400)
local hour = math.floor(time / 60 / 60) % 24
local minute = math.floor(time / 60) % 60
local second = time % 60
return day, hour, minute, second
end
function DHMSToTime(day, hour, minute, second)
return day * 86400 + hour * 3600 + minute * 60 + second
end
function GetCardinalDirection(h)
if h <= 22.5 then
return "N"
elseif h <= 67.5 then
return "NE"
elseif h <= 112.5 then
return "E"
elseif h <= 157.5 then
return "SE"
elseif h <= 202.5 then
return "S"
elseif h <= 247.5 then
return "SW"
elseif h <= 292.5 then
return "W"
elseif h <= 337.5 then
return "NW"
else
return "N"
end
end
function GetDayOfWeek(day)
return ({"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"})[day + 1]
end