mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
refactor: fully remove spawnmanager
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Core = {}
|
||||
ESX.PlayerData = {}
|
||||
ESX.playerId = PlayerId()
|
||||
ESX.serverId = GetPlayerServerId(PlayerId())
|
||||
ESX.serverId = GetPlayerServerId(ESX.playerId)
|
||||
ESX.PlayerLoaded = false
|
||||
Core.Input = {}
|
||||
ESX.UI = {}
|
||||
@@ -22,7 +22,7 @@ CreateThread(function()
|
||||
Wait(100)
|
||||
|
||||
if NetworkIsPlayerActive(ESX.playerId) then
|
||||
exports.spawnmanager:setAutoSpawn(false)
|
||||
ESX.DisableSpawnManager()
|
||||
DoScreenFadeOut(0)
|
||||
Wait(500)
|
||||
TriggerServerEvent("esx:onPlayerJoined")
|
||||
|
||||
@@ -17,6 +17,11 @@ local function IsResourceFound(resource)
|
||||
return addonResourcesState[resource] or error(('Resource [^5%s^1] is Missing!'):format(resource))
|
||||
end
|
||||
|
||||
function ESX.DisableSpawnManager()
|
||||
if GetResourceState("spawnmanager") == "started" then
|
||||
exports.spawnmanager:setAutoSpawn(false)
|
||||
end
|
||||
end
|
||||
|
||||
---@param items string | table The item(s) to search for
|
||||
---@param count? boolean Whether to return the count of the item as well
|
||||
|
||||
@@ -74,5 +74,4 @@ dependencies {
|
||||
'/native:0x6AE51D4B',
|
||||
'/native:0xA61C8FC6',
|
||||
'oxmysql',
|
||||
'spawnmanager',
|
||||
}
|
||||
|
||||
@@ -8,19 +8,13 @@ local function AwaitContext()
|
||||
return true
|
||||
end
|
||||
|
||||
local function DisableSpawnManager()
|
||||
if GetResourceState("spawnmanager") == "started" then
|
||||
exports.spawnmanager:setAutoSpawn(false)
|
||||
end
|
||||
end
|
||||
|
||||
CreateThread(function()
|
||||
|
||||
while not ESX.PlayerLoaded do
|
||||
Wait(100)
|
||||
|
||||
if NetworkIsPlayerActive(ESX.playerId) then
|
||||
DisableSpawnManager()
|
||||
ESX.DisableSpawnManager()
|
||||
DoScreenFadeOut(0)
|
||||
|
||||
local ready = AwaitContext()
|
||||
|
||||
Reference in New Issue
Block a user