Skip to content

Commit

Permalink
🎨 Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Gellipapa committed Jan 24, 2024
1 parent 1d7572f commit 9d90c9d
Show file tree
Hide file tree
Showing 123 changed files with 15,936 additions and 15,530 deletions.
56 changes: 28 additions & 28 deletions [core]/cron/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,49 @@ local Jobs = {}
local LastTime = nil

function RunAt(h, m, cb)
Jobs[#Jobs + 1] = {
h = h,
m = m,
cb = cb
}
Jobs[#Jobs + 1] = {
h = h,
m = m,
cb = cb,
}
end

function GetUnixTimestamp()
return os.time()
return os.time()
end

function OnTime(time)
for i = 1, #Jobs, 1 do
local scheduledTimestamp = os.time({
hour = Jobs[i].h,
minute = Jobs[i].m,
second = 0, -- Assuming tasks run at the start of the minute
day = os.date('%d', time),
month = os.date('%m', time),
year = os.date('%Y', time)
})

if time >= scheduledTimestamp and (not LastTime or LastTime < scheduledTimestamp) then
Jobs[i].cb(Jobs[i].h, Jobs[i].m)
end
end
for i = 1, #Jobs, 1 do
local scheduledTimestamp = os.time({
hour = Jobs[i].h,
minute = Jobs[i].m,
second = 0, -- Assuming tasks run at the start of the minute
day = os.date("%d", time),
month = os.date("%m", time),
year = os.date("%Y", time),
})

if time >= scheduledTimestamp and (not LastTime or LastTime < scheduledTimestamp) then
Jobs[i].cb(Jobs[i].h, Jobs[i].m)
end
end
end

function Tick()
local time = GetUnixTimestamp()
local time = GetUnixTimestamp()

if not LastTime or os.date('%M', time) ~= os.date('%M', LastTime) then
OnTime(time)
LastTime = time
end
if not LastTime or os.date("%M", time) ~= os.date("%M", LastTime) then
OnTime(time)
LastTime = time
end

SetTimeout(60000, Tick)
SetTimeout(60000, Tick)
end

LastTime = GetUnixTimestamp()

Tick()

AddEventHandler('cron:runAt', function(h, m, cb)
RunAt(h, m, cb)
AddEventHandler("cron:runAt", function(h, m, cb)
RunAt(h, m, cb)
end)
10 changes: 5 additions & 5 deletions [core]/es_extended/client/common.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
exports('getSharedObject', function()
return ESX
exports("getSharedObject", function()
return ESX
end)

Config.OxInventory = GetResourceState('ox_inventory'):find('start') and true
Config.OxInventory = GetResourceState("ox_inventory"):find("start") and true

AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)
Loading

0 comments on commit 9d90c9d

Please sign in to comment.