From a3a776655d25ad8f32aa34e8b6b0fbdccec3a76b Mon Sep 17 00:00:00 2001 From: someone <98275381+someone005@users.noreply.github.com> Date: Tue, 30 May 2023 15:55:35 +0200 Subject: [PATCH] Update server.lua --- server.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/server.lua b/server.lua index d495300..53ae6e4 100644 --- a/server.lua +++ b/server.lua @@ -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