refactor: fully remove spawnmanager

This commit is contained in:
Kasey FItton
2024-10-25 14:57:29 +01:00
parent 750e529faa
commit a9f76791c9
4 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -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")
+5
View File
@@ -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
-1
View File
@@ -74,5 +74,4 @@ dependencies {
'/native:0x6AE51D4B',
'/native:0xA61C8FC6',
'oxmysql',
'spawnmanager',
}
+1 -7
View File
@@ -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()