Skip to content

Commit

Permalink
Update server.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
someone005 authored May 30, 2023
1 parent 5763c9f commit a3a7766
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions server.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
local syncing = true

Citizen.CreateThread(function()
updated = false
while true do

if syncing then
local hour, minute = os.date("%H"), os.date("%M")
if not updated then
if syncing then
local hour, minute = os.date("%H"), os.date("%M")

for i=1, #Config.Updates, 1 do
local time = Config.Updates[i]
if tonumber(hour) == tonumber(string.sub(time, 1, 2)) then
if tonumber(minute) == tonumber(string.sub(time, 4, 5)) then
Update()
for i=1, #Config.Updates, 1 do
local time = Config.Updates[i]
if tonumber(hour) == tonumber(string.sub(time, 1, 2)) then
if tonumber(minute) == tonumber(string.sub(time, 4, 5)) then
Update()
updated = true
end
end
end
end
else
Wait(65000)
updated = false
end
Citizen.Wait(1000)
end
Expand Down

0 comments on commit a3a7766

Please sign in to comment.