Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #90 from coleminer0112/knight-dev
Browse files Browse the repository at this point in the history
fix: Config.bodycamOverlayEnabled and Config.bodycamEnabled
  • Loading branch information
Fireant456 authored Mar 15, 2024
2 parents 78c23a8 + b0fe701 commit 9c95306
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
46 changes: 28 additions & 18 deletions sonorancad/core/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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', {
Expand All @@ -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
Expand Down Expand Up @@ -209,6 +218,7 @@ RegisterNetEvent('SonoranCAD::Core::InitBodycam', function()
help = 'Frequency in seconds.'
}
})
end
end)

CreateThread(function()
Expand Down
2 changes: 1 addition & 1 deletion sonorancad/fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion sonorancad/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"resource" : "2.9.26",
"resource" : "2.9.27",
"testedFxServerVersion": "5932"
}

0 comments on commit 9c95306

Please sign in to comment.