mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Added ESX.JobsLoaded and esx:jobsLoaded
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
ESX = exports["es_extended"]:getSharedObject()
|
||||
ESX.currentResourceName = GetCurrentResourceName()
|
||||
|
||||
OnPlayerData = function (key, val, last) end
|
||||
OnPlayerData = function(key, val, last) end
|
||||
|
||||
local function TrackPedCoordsOnce()
|
||||
local function TrackPedCoordsOnce()
|
||||
if not ESX or not ESX.PlayerData then
|
||||
return
|
||||
end
|
||||
@@ -48,8 +48,8 @@ if not IsDuplicityVersion() then -- Only register this event for the client
|
||||
ESX.PlayerData = {}
|
||||
end)
|
||||
|
||||
local external = {{"Class", "class.lua"}, {"Point", "point.lua"}}
|
||||
for i=1, #external do
|
||||
local external = { { "Class", "class.lua" }, { "Point", "point.lua" } }
|
||||
for i = 1, #external do
|
||||
local module = external[i]
|
||||
local path = string.format("client/imports/%s", module[2])
|
||||
|
||||
@@ -78,7 +78,7 @@ else
|
||||
return
|
||||
end
|
||||
|
||||
return setmetatable({src = src}, {
|
||||
return setmetatable({ src = src }, {
|
||||
__index = function(self, method)
|
||||
return function(...)
|
||||
return exports.es_extended:RunStaticPlayerMethod(self.src, method, ...)
|
||||
@@ -87,6 +87,11 @@ else
|
||||
})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
AddEventHandler("esx:jobsLoaded", function()
|
||||
ESX.JobsLoaded = true
|
||||
end)
|
||||
end
|
||||
|
||||
if GetResourceState("ox_lib") == "missing" then
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ESX.Players = {}
|
||||
ESX.Jobs = {}
|
||||
ESX.Items = {}
|
||||
ESX.JobsLoaded = false
|
||||
Core = {}
|
||||
Core.JobsPlayerCount = {}
|
||||
Core.UsableItemsCallbacks = {}
|
||||
|
||||
@@ -445,7 +445,7 @@ function ESX.DiscordLog(name, title, color, message)
|
||||
}
|
||||
PerformHttpRequest(
|
||||
webHook,
|
||||
function ()
|
||||
function()
|
||||
return
|
||||
end,
|
||||
"POST",
|
||||
@@ -489,7 +489,7 @@ function ESX.DiscordLogFields(name, title, color, fields)
|
||||
}
|
||||
PerformHttpRequest(
|
||||
webHook,
|
||||
function ()
|
||||
function()
|
||||
return
|
||||
end,
|
||||
"POST",
|
||||
@@ -536,6 +536,8 @@ function ESX.RefreshJobs()
|
||||
else
|
||||
ESX.Jobs = Jobs
|
||||
end
|
||||
|
||||
TriggerEvent("esx:jobsLoaded")
|
||||
end
|
||||
|
||||
---@param item string
|
||||
@@ -790,5 +792,5 @@ end
|
||||
---@param plate string
|
||||
---@return CExtendedVehicle?
|
||||
function ESX.GetExtendedVehicleFromPlate(plate)
|
||||
return Core.vehicleClass.getFromPlate(plate)
|
||||
return Core.vehicleClass.getFromPlate(plate)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user