🚨wk_wars_2x Integration
Download latest version of wk_wars_2x
Go to file
cl_plate_reader.lua
On line
151
add
TriggerEvent('pp-mdt:onPlateLocked', self:GetPlate( cam ))
Restart script and check it in-game!
Full code snippet:
function READER:LockCam( cam, playBeep, isBolo, override )
-- Check that plate readers can actually be locked
if ( PLY:VehicleStateValid() and self:CanPerformMainTask() and self:GetPlate( cam ) ~= "" ) then
-- Toggle the lock state
self.vars.cams[cam].locked = not self.vars.cams[cam].locked
-- Play a beep
if ( self:GetCamLocked( cam ) ) then
-- Here we check if the override parameter is valid, if so then we set the reader's plate data to the
-- plate data provided in the override table.
if ( override ~= nil ) then
self:SetPlate( cam, override[1] )
self:SetIndex( cam, override[2] )
self:ForceNUIUpdate( false )
end
if ( playBeep ) then
SendNUIMessage( { _type = "audio", name = "beep", vol = RADAR:GetSettingValue( "plateAudio" ) } )
end
if ( isBolo ) then
SendNUIMessage( { _type = "audio", name = "plate_hit", vol = RADAR:GetSettingValue( "plateAudio" ) } )
end
-- Trigger an event so developers can hook into the scanner every time a plate is locked
TriggerServerEvent( "wk:onPlateLocked", cam, self:GetPlate( cam ), self:GetIndex( cam ) )
TriggerEvent('pp-mdt:onPlateLocked', self:GetPlate( cam ))
end
-- Tell the NUI side to show/hide the lock icon
SendNUIMessage( { _type = "lockPlate", cam = cam, state = self:GetCamLocked( cam ), isBolo = isBolo } )
end
end
Last updated