This commit is contained in:
2026-07-07 21:08:52 +02:00
commit 4c20cfc716
2613 changed files with 318021 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
ESX.Players = {}
ESX.Jobs = {}
ESX.Items = {}
RegisterNetEvent("esx:onPlayerSpawn", function()
ESX.Players[source].spawned = true
end)
if Config.CustomInventory then
SetConvarReplicated("inventory:framework", "esx")
SetConvarReplicated("inventory:weight", tostring(Config.MaxWeight * 1000))
end
local function StartDBSync()
CreateThread(function()
local interval <const> = 10 * 60 * 1000
while true do
Wait(interval)
Core.SavePlayers()
end
end)
end
MySQL.ready(function()
Core.DatabaseConnected = true
if not Config.CustomInventory then
ESX.RefreshItems()
end
ESX.RefreshJobs()
print(("[^2INFO^7] ESX ^5Legacy %s^0 initialized!"):format(GetResourceMetadata(GetCurrentResourceName(), "version", 0)))
StartDBSync()
if Config.EnablePaycheck then
StartPayCheck()
end
end)
RegisterNetEvent("esx:clientLog", function(msg)
if Config.EnableDebug then
print(("[^2TRACE^7] %s^7"):format(msg))
end
end)
RegisterNetEvent("esx:ReturnVehicleType", function(Type, Request)
if Core.ClientCallbacks[Request] then
Core.ClientCallbacks[Request](Type)
Core.ClientCallbacks[Request] = nil
end
end)
GlobalState.playerCount = 0