From 621adf63f7d867d480efcfe1b767ccb32de25230 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 30 Jan 2020 20:13:56 +0000 Subject: [PATCH] Moved plate NUI callbacks --- cl_plate_reader.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cl_plate_reader.lua b/cl_plate_reader.lua index 815bd58..aad7af7 100644 --- a/cl_plate_reader.lua +++ b/cl_plate_reader.lua @@ -39,17 +39,6 @@ READER.vars = } } --- Runs when the "Toggle Display" button is pressed on the plate reder box -RegisterNUICallback( "togglePlateReaderDisplay", function() - -- Toggle the display state - READER:ToggleDisplayState() -end ) - --- Runs when the "Toggle Display" button is pressed on the plate reder box -RegisterNUICallback( "setBoloPlate", function( plate, cb ) - READER:SetBoloPlate( plate ) -end ) - -- Gets the display state function READER:GetDisplayState() return self.vars.displayed @@ -96,6 +85,7 @@ end function READER:SetBoloPlate( plate ) self.vars.boloPlate = plate + UTIL:Notify( "BOLO plate set to: " .. plate ) end function READER:GetCamLocked( cam ) @@ -123,6 +113,17 @@ function READER:GetCamFromNum( relPos ) end end +-- Runs when the "Toggle Display" button is pressed on the plate reder box +RegisterNUICallback( "togglePlateReaderDisplay", function() + -- Toggle the display state + READER:ToggleDisplayState() +end ) + +-- Runs when the "Toggle Display" button is pressed on the plate reder box +RegisterNUICallback( "setBoloPlate", function( plate, cb ) + READER:SetBoloPlate( plate ) +end ) + function READER:Main() if ( PLY:VehicleStateValid() and self:CanPerformMainTask() ) then for i = 1, -1, -2 do @@ -141,7 +142,6 @@ function READER:Main() self:SetIndex( cam, index ) if ( plate == self:GetBoloPlate() ) then - UTIL:Notify( "DEBUG: BOLO plate hit!" ) self:LockCam( cam ) end