i hope this does work
This commit is contained in:
@@ -34,13 +34,14 @@ local function sca_setup_timezone()
|
|||||||
year = year + 1
|
year = year + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
for (month, 11, 1) do
|
for i = 0, 11, 1 do
|
||||||
if (daysPastUnixYear - daysPerMonth[i] >= daysPerMonth[i]) then
|
if (daysPastUnixYear - daysPerMonth[i] >= daysPerMonth[i]) then
|
||||||
if (i == 2 && (year % 4 == 0 && (year % 400 == 0 && year % 100 != 0))) then
|
if (i == 2 && (year % 4 == 0 && (year % 400 == 0 && year % 100 != 0))) then
|
||||||
daysPastUnixYear = daysPastUnixYear - (daysPerMonth[i] + 1)
|
daysPastUnixYear = daysPastUnixYear - (daysPerMonth[i] + 1)
|
||||||
else
|
else
|
||||||
daysPastUnixYear = daysPastUnixYear - daysPerMonth[i]
|
daysPastUnixYear = daysPastUnixYear - daysPerMonth[i]
|
||||||
end
|
end
|
||||||
|
month = month + 1
|
||||||
else
|
else
|
||||||
day = daysPastUnixYear - 1
|
day = daysPastUnixYear - 1
|
||||||
break
|
break
|
||||||
@@ -49,15 +50,28 @@ local function sca_setup_timezone()
|
|||||||
|
|
||||||
local hourInSeconds = time % 86400
|
local hourInSeconds = time % 86400
|
||||||
|
|
||||||
if (month >= 2 && month <= 9) then
|
if (month > 2 && month < 9) then
|
||||||
// Summer time
|
summerTime = true
|
||||||
|
elseif (month == 2) then
|
||||||
|
// If its less than 6 days until end of the month (aka last Weekday in the month) and its sunday and its 3 am or later....
|
||||||
|
if ((daysPerMonth[month] - day <= 6) && weekDay == 3 && hoursInSeconds >= 10800) then
|
||||||
|
summerTime = true
|
||||||
|
else
|
||||||
|
summerTime = false
|
||||||
|
end
|
||||||
|
elseif (month == 9) then
|
||||||
|
// The same action again but for winter time
|
||||||
|
if ((daysPerMonth[month] - day <= 6) && weekDay == 3 && hoursInSeconds >= 10800) then
|
||||||
|
summerTime = false
|
||||||
|
else
|
||||||
|
summerTime = true
|
||||||
|
end
|
||||||
else
|
else
|
||||||
// Winter time
|
summerTime = false
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
// Odd... Windows returns timezoned os.time, hmmm.... Need to check it on Linux
|
||||||
local function sca_msg_to_player(time)
|
local function sca_msg_to_player(time)
|
||||||
if (msg[time] != nil) then
|
if (msg[time] != nil) then
|
||||||
for k, v in ipairs(player.GetHumans()) do
|
for k, v in ipairs(player.GetHumans()) do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local conf = {
|
local conf = {
|
||||||
|
|
||||||
[71880] = '"Dies ist ein test Text!"'
|
[85200] = '"Dies ist ein test Text!"'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user