Skip to main content

QBCore

Steps

qb-multicharacter

Replace

L120, L126
exports['um-idcard']:CreateMetaLicense(src, {'id_card','driver_license'})

qb-inventory

Delete

Replace

local cardlist = {"id_card", "driver_license", "weaponlicense", "lawyerpass"}
if string.find(table.concat(cardlist, ","), itemData["name"]) then
exports['um-idcard']:CreateMetaLicense(source, itemData["name"])
QBCore.Functions.Notify(source, Lang:t("notify.yhg") ..GetPlayerName(id).." "..amount.." "..itemData["name"].. "", "success")
return
This is just an example to prevent you from making mistakes, do not use this code.

QBCore.Commands.Add("giveitem", "Give An Item (Admin Only)", {{name="id", help="Player ID"},{name="item", help="Name of the item (not a label)"}, {name="amount", help="Amount of items"}}, false, function(source, args)
local id = tonumber(args[1])
local Player = QBCore.Functions.GetPlayer(id)
local amount = tonumber(args[3]) or 1
local itemData = QBCore.Shared.Items[tostring(args[2]):lower()]
local cardlist = {"id_card", "driver_license", "weaponlicense", "lawyerpass"}

if Player then
if itemData then
-- check iteminfo
local info = {}
if string.find(table.concat(cardlist, ","), itemData["name"]) then
exports['um-idcard']:CreateMetaLicense(source, itemData["name"])
QBCore.Functions.Notify(source, Lang:t("notify.yhg") ..GetPlayerName(id).." "..amount.." "..itemData["name"].. "", "success")
return
elseif itemData["type"] == "weapon" then
amount = 1
info.serie = tostring(QBCore.Shared.RandomInt(2) .. QBCore.Shared.RandomStr(3) .. QBCore.Shared.RandomInt(1) .. QBCore.Shared.RandomStr(2) .. QBCore.Shared.RandomInt(3) .. QBCore.Shared.RandomStr(4))
info.quality = 100
elseif itemData["name"] == "harness" then
info.uses = 20
elseif itemData["name"] == "markedbills" then
info.worth = math.random(5000, 10000)
elseif itemData["name"] == "labkey" then
info.lab = exports["qb-methlab"]:GenerateRandomLab()
elseif itemData["name"] == "printerdocument" then
info.url = "https://cdn.discordapp.com/attachments/870094209783308299/870104331142189126/Logo_-_Display_Picture_-_Stylized_-_Red.png"
end

if AddItem(id, itemData["name"], amount, false, info) then
QBCore.Functions.Notify(source, Lang:t("notify.yhg") ..GetPlayerName(id).." "..amount.." "..itemData["name"].. "", "success")
else
QBCore.Functions.Notify(source, Lang:t("notify.cgitem"), "error")
end
else
QBCore.Functions.Notify(source, Lang:t("notify.idne"), "error")
end
else
QBCore.Functions.Notify(source, Lang:t("notify.pdne"), "error")
end
end, "admin")

qb-cityhall

Replace

local function giveStarterItems()
local Player = QBCore.Functions.GetPlayer(source)
if not Player then return end
exports['um-idcard']:CreateMetaLicense(source, {'id_card','driver_license'})
end
RegisterNetEvent('qb-cityhall:server:requestId', function(item, hall)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
local itemInfo = Config.Cityhalls[hall].licenses[item]
if not Player.Functions.RemoveMoney("cash", itemInfo.cost) then return TriggerClientEvent('QBCore:Notify', src, ('You don\'t have enough money on you, you need %s cash'):format(itemInfo.cost), 'error') end
if item == "id_card" then
exports['um-idcard']:CreateMetaLicense(src, 'id_card')
elseif item == "driver_license" then
exports['um-idcard']:CreateMetaLicense(src, 'driver_license')
elseif item == "weaponlicense" then
exports['um-idcard']:CreateMetaLicense(src, 'weaponlicense')
else
return false -- DropPlayer(src, 'Attempted exploit abuse')
end
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add')
end)