diff --git a/README.md b/README.md index cc74492..b7eeac6 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,6 @@ If you don't want to use the `ox_lib` Skillbar then remove it from `fxmanifest.l * [ESX 1.2 and above](https://github.com/esx-framework/esx_core) or [QBCore](https://github.com/qbcore-framework) * [datacrack by utkuali](https://github.com/utkuali/datacrack) * [ox_lib](https://github.com/overextended/ox_lib) + +## Optional Requirements +* [doors_creator by Jaksam](https://www.jaksam-scripts.com/) - *To unlock all doors while blackout* \ No newline at end of file diff --git a/VERSION b/VERSION index 9f8e9b6..b123147 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0 \ No newline at end of file +1.1 \ No newline at end of file diff --git a/config.lua b/config.lua index f9e1ad7..d7dabc8 100644 --- a/config.lua +++ b/config.lua @@ -16,6 +16,8 @@ end Config.Framework = 'ESX' -- 'ESX' or 'QBCore' Config.Hotkey = 38 -- deafult: 38 = E ---------------------------------------------------------------- +Config.useDoorsCreator = false -- Set to true if you use Jaksams Doors Creator and want to unlock all Doors while blackout +---------------------------------------------------------------- Config.Blackout = { generalLights = true, -- Set to true turns off all artificial light sources in the map vehicleLights = true, -- Set to false ignores Vehicles diff --git a/fxmanifest.lua b/fxmanifest.lua index caeca39..e4e170b 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,7 +4,7 @@ games { 'gta5' } author 'Musiker15 - MSK Scripts' name 'msk_blackout' description 'Weather Blackout Miniheist' -version '1.0' +version '1.1' lua54 'yes' diff --git a/server.lua b/server.lua index 53469e6..57fdf74 100644 --- a/server.lua +++ b/server.lua @@ -45,6 +45,18 @@ AddEventHandler('msk_blackout:syncBlackout', function(state) Config.weatherScript(state) end TriggerClientEvent('msk_blackout:setBlackout', -1, state) + + if Config.useDoorsCreator and state then + local doors = exports["doors_creator"]:getAllDoors() + for k, doorData in pairs(doors) do + exports["doors_creator"]:setDoorState(doorData.id, 0) + end + elseif Config.useDoorsCreator and not state then + local doors = exports["doors_creator"]:getAllDoors() + for k, doorData in pairs(doors) do + exports["doors_creator"]:setDoorState(doorData.id, 1) + end + end end) logging = function(code, ...)