New event name: esx:jobsRefreshed,

Removed prints
This commit is contained in:
Kr3mu
2025-07-30 10:44:24 +02:00
parent 01a5703c50
commit f01025d506
+15 -9
View File
@@ -269,7 +269,8 @@ function Core.SavePlayers(cb)
return cb()
end
print(("[^2INFO^7] Saved ^5%s^7 %s over ^5%s^7 ms"):format(#parameters, #parameters > 1 and "players" or "player", ESX.Math.Round((os.time() - startTime) / 1000000, 2)))
print(("[^2INFO^7] Saved ^5%s^7 %s over ^5%s^7 ms"):format(#parameters,
#parameters > 1 and "players" or "player", ESX.Math.Round((os.time() - startTime) / 1000000, 2)))
end
)
end
@@ -434,7 +435,8 @@ function ESX.DiscordLog(name, title, color, message)
["color"] = Config.DiscordLogs.Colors[color] or Config.DiscordLogs.Colors.default,
["footer"] = {
["text"] = "| ESX Logs | " .. os.date(),
["icon_url"] = "https://cdn.discordapp.com/attachments/944789399852417096/1020099828266586193/blanc-800x800.png",
["icon_url"] =
"https://cdn.discordapp.com/attachments/944789399852417096/1020099828266586193/blanc-800x800.png",
},
["description"] = message,
["author"] = {
@@ -477,7 +479,8 @@ function ESX.DiscordLogFields(name, title, color, fields)
["color"] = Config.DiscordLogs.Colors[color] or Config.DiscordLogs.Colors.default,
["footer"] = {
["text"] = "| ESX Logs | " .. os.date(),
["icon_url"] = "https://cdn.discordapp.com/attachments/944789399852417096/1020099828266586193/blanc-800x800.png",
["icon_url"] =
"https://cdn.discordapp.com/attachments/944789399852417096/1020099828266586193/blanc-800x800.png",
},
["fields"] = fields,
["description"] = "",
@@ -539,7 +542,7 @@ function ESX.RefreshJobs()
ESX.Jobs = Jobs
end
TriggerEvent("esx:jobsLoaded")
TriggerEvent("esx:jobsRefreshed")
Core.JobsLoaded = true
end
@@ -562,7 +565,9 @@ function ESX.UseItem(source, item, ...)
local success, result = pcall(itemCallback, source, item, ...)
if not success then
return result and print(result) or print(('[^3WARNING^7] An error occured when using item ^5"%s"^7! This was not caused by ESX.'):format(item))
return result and print(result) or
print(('[^3WARNING^7] An error occured when using item ^5"%s"^7! This was not caused by ESX.'):format(
item))
end
end
else
@@ -601,7 +606,6 @@ end
---@return table
function ESX.GetJobs()
while not Core.JobsLoaded do
print("Waiting for ESX Jobs to Load")
Citizen.Wait(200)
end
@@ -688,7 +692,8 @@ if not Config.CustomInventory then
local itemCount = #items
for i = 1, itemCount do
local item = items[i]
ESX.Items[item.name] = { label = item.label, weight = item.weight, rare = item.rare, canRemove = item.can_remove }
ESX.Items[item.name] = { label = item.label, weight = item.weight, rare = item.rare, canRemove = item
.can_remove }
end
refreshPlayerInventories()
@@ -750,7 +755,9 @@ if not Config.CustomInventory then
end
if #toInsert > 0 then
MySQL.prepare.await("INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES (?, ?, ?, ?, ?)", toInsert)
MySQL.prepare.await(
"INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES (?, ?, ?, ?, ?)",
toInsert)
for i = 1, #toInsert do
local row = toInsert[i]
@@ -772,7 +779,6 @@ end
---@return boolean
function ESX.DoesJobExist(job, grade)
while not Core.JobsLoaded do
print("Waiting for ESX Jobs to Load")
Citizen.Wait(200)
end