From cd5aefab1eb9cf6181ac9eb7ef56003a98d52c34 Mon Sep 17 00:00:00 2001 From: primis <159195382+9primis@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:07:28 -0500 Subject: [PATCH] refactor(client): use lib.load and config documentation Converted json file to Lua, and added documentation in regards to what each value does. --- qbx_disableservices/client.lua | 7 +++---- qbx_disableservices/config.json | 20 -------------------- qbx_disableservices/config.lua | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 qbx_disableservices/config.json create mode 100644 qbx_disableservices/config.lua diff --git a/qbx_disableservices/client.lua b/qbx_disableservices/client.lua index caacc7f..74e6aee 100644 --- a/qbx_disableservices/client.lua +++ b/qbx_disableservices/client.lua @@ -1,9 +1,8 @@ -local config = lib.loadJson('qbx_disableservices.config') +local config = lib.load('qbx_disableservices.config') CreateThread(function() + SetMaxWantedLevel(config.maxWantedLevel) for key, value in ipairs(config.enabledServices) do EnableDispatchService(key, value) end - - SetMaxWantedLevel(config.maxWantedLevel) -end) +end) \ No newline at end of file diff --git a/qbx_disableservices/config.json b/qbx_disableservices/config.json deleted file mode 100644 index e2fc430..0000000 --- a/qbx_disableservices/config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "enabledServices": [ - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - "maxWantedLevel": 0 -} diff --git a/qbx_disableservices/config.lua b/qbx_disableservices/config.lua new file mode 100644 index 0000000..1ac79be --- /dev/null +++ b/qbx_disableservices/config.lua @@ -0,0 +1,20 @@ +return { + maxWantedLevel = 0, + enabledServices = { + [1] = false, -- PoliceAutomobile + [2] = false, -- PoliceHelicopter + [3] = false, -- FireDepartment + [4] = false, -- SwatAutomobile + [5] = false, -- AmbulanceDepartment + [6] = false, -- PoliceRiders + [7] = false, -- PoliceVehicleRequest + [8] = true, -- PoliceRoadBlock + [9] = false, -- PoliceAutomobileWaitPulledOver + [10] = false, -- PoliceAutomobileWaitCruising + [11] = false, -- Gangs + [12] = false, -- SwatHelicopter + [13] = false, -- PoliceBoat + [14] = false, -- ArmyVehicle + [15] = false -- BikerBackup + }, +} \ No newline at end of file