Licences
Licences are always read from the player's QBCore metadata (metadata.licences). Granting or revoking through the exports or commands updates the metadata and saves it to the database straight away.
Exports
Use the player's server ID or citizen ID as the target. Offline players are edited in the database.
Lua
exports.sbcityhall:RevokeLicense(target, 'driver') -- ok, message
exports.sbcityhall:RevokeLicense(target, 'weapon', { removeItems = false, notify = false })
exports.sbcityhall:GrantLicense(target, 'weapon') -- ok, message
exports.sbcityhall:HasLicense(target, 'driver') -- true or false
exports.sbcityhall:GetLicenses(target) -- { driver = true, weapon = false }Revoking also removes matching documents, which are any Config.Documents entries with that license, unless Config.Licenses.RemoveItemsOnRevoke = false. Online players are notified. Revoked licences show as Revoked on the Document Desk and My Record, with a note to contact the police department.
Listen for changes with:
Lua
AddEventHandler('sbcityhall:server:licenseChanged', function(citizenid, license, value) end)Commands
/revokelicense [id] [license]/grantlicense [id] [license]
These are for admins and the jobs and grades in Config.Licenses.Commands. By default that's police at grade 2 and above, on duty.
Last updated 2026-11-08
