1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-27 04:29:23 +02:00
parent 2f18b63e8e
commit 4d0046b454
2 changed files with 30 additions and 26 deletions

View file

@ -874,37 +874,40 @@ RegisterNetEvent('spy-bodycam:client:refreshRecords',function(records,isBoss)
end) end)
-- Register hotkeys for recording if enabled in config -- Register hotkeys for recording if enabled in config
if Config.EnableRecordingHotkeys then Citizen.CreateThread(function()
-- Bodycam recording hotkey if Config.EnableRecordingHotkeys then
RegisterKeyMapping('bodycamrecord', 'Start/Stop bodycam recording', 'keyboard', Config.RecordHotkey) -- Bodycam recording hotkey
RegisterCommand('bodycamrecord', function() RegisterKeyMapping('bodycamrecord', 'Start/Stop bodycam recording', 'keyboard', Config.RecordHotkey)
if bcamstate then -- Only if bodycam is active RegisterCommand('bodycamrecord', function()
TriggerServerEvent('spy-bodycam:server:toggleRecording') if bcamstate then -- Only if bodycam is active
else TriggerServerEvent('spy-bodycam:server:toggleRecording')
NotifyPlayer('Bodycam not activated!', 'error', 2500) else
end NotifyPlayer('Bodycam not activated!', 'error', 2500)
end) end
end, false)
-- Dashcam recording hotkey -- Dashcam recording hotkey
RegisterKeyMapping('dashcamrecord', 'Start/Stop dashcam recording', 'keyboard', Config.DashcamHotkey) RegisterKeyMapping('dashcamrecord', 'Start/Stop dashcam recording', 'keyboard', Config.DashcamHotkey)
RegisterCommand('dashcamrecord', function() RegisterCommand('dashcamrecord', function()
if IsPedInAnyVehicle(cache.ped, false) then if IsPedInAnyVehicle(cache.ped, false) then
local veh = GetVehiclePedIsIn(cache.ped, false) local veh = GetVehiclePedIsIn(cache.ped, false)
if isCarAuth(veh) then if isCarAuth(veh) then
local netId = NetworkGetNetworkIdFromEntity(veh) local netId = NetworkGetNetworkIdFromEntity(veh)
if GlobalState.CarsOnBodycam[netId] then if GlobalState.CarsOnBodycam[netId] then
TriggerServerEvent('spy-bodycam:server:toggleDashcamRecording', netId) TriggerServerEvent('spy-bodycam:server:toggleDashcamRecording', netId)
else
NotifyPlayer('Dashcam not activated in this vehicle!', 'error', 2500)
end
else else
NotifyPlayer('Dashcam not activated in this vehicle!', 'error', 2500) NotifyPlayer('Vehicle not authorized for dashcam!', 'error', 2500)
end end
else else
NotifyPlayer('Vehicle not authorized for dashcam!', 'error', 2500) NotifyPlayer('You need to be in a vehicle to use dashcam!', 'error', 2500)
end end
else end, false)
NotifyPlayer('You need to be in a vehicle to use dashcam!', 'error', 2500) end
end end)
end)
end
RegisterKeyMapping('bodycamexit', 'Exit bodycam spectate', 'keyboard', Config.ExitCamKey) RegisterKeyMapping('bodycamexit', 'Exit bodycam spectate', 'keyboard', Config.ExitCamKey)
RegisterCommand('bodycamexit', function() RegisterCommand('bodycamexit', function()

View file

@ -217,6 +217,7 @@ RegisterNetEvent('spy-bodycam:server:toggleDashcamRecording', function(netId)
end end
end) end)
RegisterNetEvent('spy-bodycam:server:logVideoDetails', function(videoUrl, streetName, isDashcam) RegisterNetEvent('spy-bodycam:server:logVideoDetails', function(videoUrl, streetName, isDashcam)
local src = source local src = source
local offName local offName