From eacf7c0b9419ebb444d8003a0ad03e0ebcd0d172 Mon Sep 17 00:00:00 2001 From: ArkSeyonet <31637812+ArkSeyonet@users.noreply.github.com> Date: Sun, 17 May 2020 04:16:00 -0500 Subject: [PATCH] Update es_extended - Finish removing code for forcing stop resources --- config.lua | 2 -- server/main.lua | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/config.lua b/config.lua index 8bf546f3..93e400db 100644 --- a/config.lua +++ b/config.lua @@ -14,5 +14,3 @@ Config.EnableHud = true -- enable the default hud? Display current jo Config.MaxWeight = 24 -- the max inventory weight without backpack Config.PaycheckInterval = 7 * 60000 -- how often to recieve pay checks in milliseconds Config.EnableDebug = false - -Config.IncompatibleResourcesToStop = {} diff --git a/server/main.lua b/server/main.lua index 2d82d2fe..5a1f7ac3 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,35 +1,6 @@ Citizen.CreateThread(function() SetMapName('San Andreas') SetGameType('Roleplay') - local resourcesStopped, isAceGranted = {}, false - - for resourceName,reason in pairs(Config.IncompatibleResourcesToStop) do - local status = GetResourceState(resourceName) - - if status == 'started' or status == 'starting' then - while GetResourceState(resourceName) == 'starting' do - Citizen.Wait(100) - end - - if not isAceGranted then - ExecuteCommand('add_ace resource.es_extended command.stop allow') - isAceGranted = true - end - - ExecuteCommand(('stop %s'):format(resourceName)) - resourcesStopped[resourceName] = reason - end - end - - if ESX.Table.SizeOf(resourcesStopped) > 0 then - local allStoppedResources = '' - - for resourceName,reason in pairs(resourcesStopped) do - allStoppedResources = ('%s\n- ^3%s^7, %s'):format(allStoppedResources, resourceName, reason) - end - - print(('[es_extended] [^3WARNING^7] Stopped %s incompatible resource(s) that can cause issues when used with ESX. They are not needed and can safely be removed from your server, remove these resource(s) from your resource directory and your configuration file:%s'):format(ESX.Table.SizeOf(resourcesStopped), allStoppedResources)) - end end) RegisterNetEvent('esx:onPlayerJoined')