📃
Docs
  • 👋Welcome
  • 🌉Bridge
    • 💾Installation
    • 🌐Compatibility
    • 👨Client exports
      • ⏩Framework
        • getName
        • getJob
        • TriggerServerCallback
        • getSex
      • 🎒Inventory
        • getItemCount
      • 👁️Target
    • 🖥️Server exports
      • 🗃️Database
        • getUserData
        • getVehicleData
      • 🎒Inventory
        • openInventory
        • addItem
        • removeItem
        • canCarryItem
        • getItemCount
        • registerStash
        • setDurability
      • ⏩Framework
        • getPlayerFromId
        • getPlayerFromIdentifier
        • getIdentifier
        • RegisterServerCallback
        • getSource
        • getName
        • getJob
        • getAllPlayers
        • setJob
        • doesJobExist
        • getCoords
        • getJobs
  • 🔫Organization Panel
    • 📝Configuration
    • 💾Installation
    • 🗃️Framework integration
      • 💼ESX
        • 🚪ox_doorlock usage
      • 💼QBCore
        • 🚪ox_doorlock usage
      • 💼Other framework
    • 💻Server
      • Server exports
      • Server events
    • 👨Client
      • Client exports
  • ♣️Bossmenu
    • 📝Configuration
    • 💾Installation
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBCore & QBOX
      • 🖼️Other Framework
    • 🖥️Server
      • 🔁Events
      • 🔃Exports
    • 👨Client
      • 🔁Events
      • 🔃Exports
  • 🕺Adjust Animation
    • 🗒️Configuration
    • 💾Installation
    • 📚Other scripts integration
      • 💃scully_emotemenu
      • 💃rpemotes
      • 💃other
  • 👮Police MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBOX/QB-Core
      • 🖼️Other Framework
    • 🚨wk_wars_2x Integration
    • 📚Exports
      • 🔃Server
      • 👨Client
  • 👨‍💼DOJ MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 👨Client
  • 🩺EMS MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 🔃Server
      • 👨Client
Powered by GitBook
On this page

Was this helpful?

  1. Police MDT

wk_wars_2x Integration

PreviousOther FrameworkNextExports

Last updated 8 months ago

Was this helpful?

  1. Download latest version of

  2. Go to file cl_plate_reader.lua

  3. On line 151 add

TriggerEvent('pp-mdt:onPlateLocked', self:GetPlate( cam ))
  1. 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
👮
🚨
wk_wars_2x