Skip to content

Commit

Permalink
Merge pull request #1292 from esx-framework/dev
Browse files Browse the repository at this point in the history
🎉 New release 1.10.3
  • Loading branch information
Gellipapa authored Jan 24, 2024
2 parents 8b405be + 9d90c9d commit 922b633
Show file tree
Hide file tree
Showing 127 changed files with 16,551 additions and 15,123 deletions.
1 change: 1 addition & 0 deletions [SQL]/legacy.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ CREATE TABLE IF NOT EXISTS `banking` (
`time` bigint(20) DEFAULT NULL,
`ID` int(11) NOT NULL AUTO_INCREMENT,
`balance` int(11) DEFAULT 0,
`label` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

Expand Down
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)
12 changes: 5 additions & 7 deletions [core]/es_extended/client/common.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
exports('getSharedObject', function()
return ESX
exports("getSharedObject", function()
return ESX
end)

if GetResourceState('ox_inventory') ~= 'missing' then
Config.OxInventory = true
end
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 922b633

Please sign in to comment.