From 0fe8b24212e81195fccc835599ed8b3e2405a26c Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 7 Jan 2021 14:17:24 +0000 Subject: [PATCH] Added config option for Sonoran CAD users --- cl_plate_reader.lua | 7 +++++-- config.lua | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cl_plate_reader.lua b/cl_plate_reader.lua index 182ff83..7ceada4 100644 --- a/cl_plate_reader.lua +++ b/cl_plate_reader.lua @@ -257,8 +257,11 @@ function READER:Main() -- Send the plate information to the NUI side to update the UI SendNUIMessage( { _type = "changePlate", cam = cam, plate = plate, index = index } ) - -- Trigger the event so developers can hook into the scanner every time a plate is scanned - TriggerServerEvent( "wk:onPlateScanned", cam, plate, index ) + -- If we use Sonoran CAD, reduce the plate events to just player's vehicle, otherwise life as normal + if ( ( CONFIG.use_sonorancad and ( UTIL:IsPlayerInVeh( veh ) or IsVehiclePreviouslyOwnedByPlayer( veh ) ) and GetVehicleClass( veh ) ~= 18 ) or not CONFIG.use_sonorancad ) then + -- Trigger the event so developers can hook into the scanner every time a plate is scanned + TriggerServerEvent( "wk:onPlateScanned", cam, plate, index ) + end end end end diff --git a/config.lua b/config.lua index ea81ddb..f9eeb61 100644 --- a/config.lua +++ b/config.lua @@ -59,6 +59,9 @@ CONFIG.allow_passenger_view = true -- radar remote and control the radar and plate reader for themself and the driver. CONFIG.allow_passenger_control = false +-- Set this to true if you use Sonoran CAD with the WraithV2 plugin +CONFIG.use_sonorancad = false + -- Sets the defaults of all keybinds -- These keybinds can be changed by each person in their GTA Settings->Keybinds->FiveM CONFIG.keyDefaults =