diff --git a/sonorancad/core/client.lua b/sonorancad/core/client.lua index 210fe3e..f94efc4 100644 --- a/sonorancad/core/client.lua +++ b/sonorancad/core/client.lua @@ -108,19 +108,24 @@ end) SonoranCAD Bodycam Callback if unit is not found in CAD ]] RegisterNetEvent('SonoranCAD::core::ScreenshotOff', function() - bodyCamOn = false - SendNUIMessage({ - type = 'toggleGif' - }) - TriggerEvent('chat:addMessage', { - args = { - 'Sonoran Bodycam', - 'Bodycam disabled - You must be in CAD to enable bodycam' - } - }) + if Config.bodycamEnabled then + bodyCamOn = false + if Config.bodycamOverlayEnabled then + SendNUIMessage({ + type = 'toggleGif' + }) + end + TriggerEvent('chat:addMessage', { + args = { + 'Sonoran Bodycam', + 'Bodycam disabled - You must be in CAD to enable bodycam' + } + }) + end end) RegisterNetEvent('SonoranCAD::Core::InitBodycam', function() + if Config.bodycamEnabled then print('Bodycam init') -- Command to toggle bodycam on and off RegisterCommand(Config.bodycamCommandToggle, function(source, args, rawCommand) @@ -143,10 +148,12 @@ RegisterNetEvent('SonoranCAD::Core::InitBodycam', function() 'Bodycam disabled.' } }) - SendNUIMessage({ - type = 'toggleGif', - location = Config.bodycamOverlayLocation - }) + if Config.bodycamOverlayEnabled then + SendNUIMessage({ + type = 'toggleGif', + location = Config.bodycamOverlayLocation + }) + end else bodyCamOn = true TriggerEvent('chat:addMessage', { @@ -155,10 +162,12 @@ RegisterNetEvent('SonoranCAD::Core::InitBodycam', function() 'Bodycam enabled.' } }) - SendNUIMessage({ - type = 'toggleGif', - location = Config.bodycamOverlayLocation - }) + if Config.bodycamOverlayEnabled then + SendNUIMessage({ + type = 'toggleGif', + location = Config.bodycamOverlayLocation + }) + end end end, false) -- Command to change the frequency of bodycam screenshots @@ -209,6 +218,7 @@ RegisterNetEvent('SonoranCAD::Core::InitBodycam', function() help = 'Frequency in seconds.' } }) + end end) CreateThread(function() diff --git a/sonorancad/fxmanifest.lua b/sonorancad/fxmanifest.lua index 6d4339c..fb159ed 100644 --- a/sonorancad/fxmanifest.lua +++ b/sonorancad/fxmanifest.lua @@ -3,7 +3,7 @@ games {'gta5'} author 'Sonoran CAD' description 'Sonoran CAD FiveM Integration' -version '2.9.26' +version '2.9.27' server_scripts { 'core/http.js' diff --git a/sonorancad/version.json b/sonorancad/version.json index 5a9b517..ebfa7bf 100644 --- a/sonorancad/version.json +++ b/sonorancad/version.json @@ -1,4 +1,4 @@ { - "resource" : "2.9.26", + "resource" : "2.9.27", "testedFxServerVersion": "5932" }