Skip to content

Commit

Permalink
refactor(client): use lib.load and config documentation
Browse files Browse the repository at this point in the history
Converted json file to Lua, and added documentation in regards to what each value does.
  • Loading branch information
9primis committed Jul 11, 2024
1 parent e183c8f commit cd5aefa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
7 changes: 3 additions & 4 deletions qbx_disableservices/client.lua
Original file line number Diff line number Diff line change
@@ -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)
20 changes: 0 additions & 20 deletions qbx_disableservices/config.json

This file was deleted.

20 changes: 20 additions & 0 deletions qbx_disableservices/config.lua
Original file line number Diff line number Diff line change
@@ -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
},
}

0 comments on commit cd5aefa

Please sign in to comment.