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

View file

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