Describe the bug
I'm having the problem of when you issue the Weapon lic thru ps mdt or the /grantlic. command you go to the city hall and is does not show at all now i can go restart just city hall and it shows up then but i if i revoke the weapon lic and reissue it the lic it won't show up unless you restart the script then it shows up just fine.
To Reproduce
Steps to reproduce the behavior:
Go to 'City Hall'
Type in '/grantlic (id) weapon'
Check to see if lic cause on my side i dont see it
if it not there then restart city hall only
Expected behavior
Give Weapon Lic..
Screenshots
If applicable, add screenshots to help explain your problem.
Questions (please complete the following information):
When you last updated: [12/3/2023]
Are you using custom resource? which ones? [N/A]
Have you renamed qb- to something custom? [NO]
Additional context
Here is the Code for Grant Lic.
QBCore.Commands.Add("grantlicense", Lang:t("commands.license_grant"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then
if args[2] == "driver" or args[2] == "weapon" then
local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if not SearchedPlayer then return end
local licenseTable = SearchedPlayer.PlayerData.metadata["licences"]
if licenseTable[args[2]] then
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.license_already"), "error")
return
end
licenseTable[args[2]] = true
SearchedPlayer.Functions.SetMetaData("licences", licenseTable)
TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("success.granted_license"), "success")
TriggerClientEvent('QBCore:Notify', src, Lang:t("success.grant_license"), "success")
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license_type"), "error")
end
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_license"), "error")
end
end)
QBCore.Commands.Add("revokelicense", Lang:t("commands.license_revoke"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then
if args[2] == "driver" or args[2] == "weapon" then
local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if not SearchedPlayer then return end
local licenseTable = SearchedPlayer.PlayerData.metadata["licences"]
if not licenseTable[args[2]] then
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error")
return
end
licenseTable[args[2]] = false
SearchedPlayer.Functions.SetMetaData("licences", licenseTable)
TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("error.revoked_license"), "error")
TriggerClientEvent('QBCore:Notify', src, Lang:t("success.revoke_license"), "success")
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error")
end
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_revoke"), "error")
end
end)
I have tried going to a discord support call but no one was wanting too help out on this any help will be helpful. THANK YOU!!!
Describe the bug I'm having the problem of when you issue the Weapon lic thru ps mdt or the /grantlic. command you go to the city hall and is does not show at all now i can go restart just city hall and it shows up then but i if i revoke the weapon lic and reissue it the lic it won't show up unless you restart the script then it shows up just fine.
To Reproduce Steps to reproduce the behavior:
Expected behavior Give Weapon Lic..
Screenshots If applicable, add screenshots to help explain your problem.
Questions (please complete the following information):
qb-
to something custom? [NO]Additional context Here is the Code for Grant Lic. QBCore.Commands.Add("grantlicense", Lang:t("commands.license_grant"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args) local src = source local Player = QBCore.Functions.GetPlayer(src) if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then if args[2] == "driver" or args[2] == "weapon" then local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1])) if not SearchedPlayer then return end local licenseTable = SearchedPlayer.PlayerData.metadata["licences"] if licenseTable[args[2]] then TriggerClientEvent('QBCore:Notify', src, Lang:t("error.license_already"), "error") return end licenseTable[args[2]] = true SearchedPlayer.Functions.SetMetaData("licences", licenseTable) TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("success.granted_license"), "success") TriggerClientEvent('QBCore:Notify', src, Lang:t("success.grant_license"), "success") else TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license_type"), "error") end else TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_license"), "error") end end)
QBCore.Commands.Add("revokelicense", Lang:t("commands.license_revoke"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args) local src = source local Player = QBCore.Functions.GetPlayer(src) if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then if args[2] == "driver" or args[2] == "weapon" then local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1])) if not SearchedPlayer then return end local licenseTable = SearchedPlayer.PlayerData.metadata["licences"] if not licenseTable[args[2]] then TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error") return end licenseTable[args[2]] = false SearchedPlayer.Functions.SetMetaData("licences", licenseTable) TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("error.revoked_license"), "error") TriggerClientEvent('QBCore:Notify', src, Lang:t("success.revoke_license"), "success") else TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error") end else TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_revoke"), "error") end end)
I have tried going to a discord support call but no one was wanting too help out on this any help will be helpful. THANK YOU!!!