Add callbacks to all events to prevent requests from stalling

This commit is contained in:
Jamelele
2020-05-24 15:22:39 +00:00
parent 9de5694899
commit e0931ed351
2 changed files with 20 additions and 10 deletions

View File

@@ -174,15 +174,17 @@ AddEventHandler( "wk:togglePlateLock", function( cam, beep, bolo )
end )
-- Runs when the "Toggle Display" button is pressed on the plate reder box
RegisterNUICallback( "togglePlateReaderDisplay", function()
RegisterNUICallback( "togglePlateReaderDisplay", function( data, cb )
-- Toggle the display state
READER:ToggleDisplayState()
cb({})
end )
-- Runs when the "Set BOLO Plate" button is pressed on the plate reader box
RegisterNUICallback( "setBoloPlate", function( plate, cb )
-- Set the BOLO plate
READER:SetBoloPlate( plate )
cb({})
end )
-- This is the main function that runs and scans all vehicles in front and behind the patrol vehicle