Added ability to clear the BOLO plate

This commit is contained in:
Dan
2020-11-05 15:33:21 +00:00
parent dc8875893f
commit 4f7d56471b
4 changed files with 26 additions and 3 deletions

View File

@@ -114,13 +114,21 @@ end
-- Returns the bolo plate
function READER:GetBoloPlate()
return self.vars.boloPlate
if ( self.vars.boloPlate ~= nil ) then
return self.vars.boloPlate
end
end
-- Sets the bolo plate to the given plate
function READER:SetBoloPlate( plate )
self.vars.boloPlate = plate
UTIL:Notify( "BOLO plate set to: " .. plate )
UTIL:Notify( "BOLO plate set to: ~b~" .. plate )
end
-- Clears the BOLO plate
function READER:ClearBoloPlate()
self.vars.boloPlate = nil
UTIL:Notify( "~b~BOLO plate cleared!" )
end
-- Returns if the given reader is locked
@@ -187,6 +195,13 @@ RegisterNUICallback( "setBoloPlate", function( plate, cb )
cb('ok')
end )
-- Runs when the "Clear BOLO Plate" button is pressed on the plate reader box
RegisterNUICallback( "clearBoloPlate", function( plate, cb )
-- Clear the BOLO plate
READER:ClearBoloPlate()
cb( "ok" )
end )
-- This is the main function that runs and scans all vehicles in front and behind the patrol vehicle
function READER:Main()
-- Check that the system can actually run