## Police Serial Weapon Lock
1 messages · Page 1 of 1 (latest)
First release. Blocks usage and auto-confiscates any weapon whose serial contains "POL" from non-p
My first release
Police Serial Weapon Lock
Interesting..I personally prefer investigating why a criminal had a police issued weapon and then gunning them down in a hail of bullets thus proving im the top dog but I could see how people might like this!
hahahah , i appriecate that 💛
nice, will test this out.
have you considered something like this? ```lua
local isPlayerCop = false
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
Wait(1500)
local player = exports.qbx_core:GetPlayerData()
if not player or not player.job then return end
isPlayerCop = player.job.name == 'police' or false
end)
RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
isPlayerCop = false
end)
RegisterNetEvent('QBCore:Client:OnJobUpdate', function(data)
isPlayerCop = data.name == 'police' or false
end)
RegisterNetEvent('ox_inventory:currentWeapon', function(weapon)
if not weapon then return end
local weaponData = weapon.metadata and weapon.metadata.serial
if not weaponData then return end
local search = string.find(weaponData:upper(), 'POL', 1, true)
if not search then return end
if isPlayerCop then return end
TriggerEvent("ox_inventory:disarm", true)
exports.qbx_core:Notify("Must be a cop to use this "..(weapon.label or weapon.name), 'error')
end)
Are you able to make this kinda configurable with the ability to add multiple serial numbers & jobs