From 56abe5e36ea8aac119622230c1f3e51dab4924d7 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 18 Feb 2020 17:01:08 +0000 Subject: [PATCH] Plate reader only beeps when a plate is locked --- cl_plate_reader.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cl_plate_reader.lua b/cl_plate_reader.lua index 53d332a..8394d94 100644 --- a/cl_plate_reader.lua +++ b/cl_plate_reader.lua @@ -94,7 +94,7 @@ end -- Sets the bolo plate to the given plate function READER:SetBoloPlate( plate ) - self.vars.boloPlate = plate + self.vars.boloPlate = plate UTIL:Notify( "BOLO plate set to: " .. plate ) end @@ -113,8 +113,10 @@ function READER:LockCam( cam ) -- Tell the NUI side to show/hide the lock icon SendNUIMessage( { _type = "lockPlate", cam = cam, state = self:GetCamLocked( cam ) } ) - -- Play a beep - SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } ) + -- Play a beep + if ( self:GetCamLocked( cam ) ) then + SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "beep" ) } ) + end end end