QBCore Frameworkqbcore.netCommunity docs
On this page

3 min read

QBCore Weapon License

The current QBCore weapon-license flow spans multiple resources:

  1. qb-policejob grants or revokes the permission state.
  2. qb-core stores that state in PlayerData.metadata.licences.weapon.
  3. qb-cityhall lets an eligible player buy the hard-copy license item.
  4. qb-shops can require the weapon license before selling configured products.

The metadata permission and the physical license item are different things.

Default metadata state

Current qb-core initializes license metadata like this:

licences = {
    driver = true,
    business = false,
    weapon = false
}

So a new character does not have weapon-license permission by default.

Read it server-side from:

local Player = exports['qb-core']:GetPlayer(source)
if not Player then return end

local hasWeaponLicense = Player.PlayerData.metadata.licences.weapon == true

Do not trust a client-provided Boolean for purchase authorization.

Grant a weapon license

Current qb-policejob documents:

/grantlicense [id] [license]

For a weapon license:

/grantlicense 12 weapon

The command is available to police who meet Config.LicenseRank. The official resource defaults that threshold to grade 2.

Revoke a weapon license

Current command documentation uses:

/revokelicense [id] [license]

Example:

/revokelicense 12 weapon

Legacy docs use a different command

Older QBCore prose still contains /revoke [id] [licenseType]. The current command reference and qb-policejob documentation use /revokelicense. Verify the command registered by the exact qb-policejob commit you deploy.

Revoking metadata permission does not automatically remove a previously issued hard-copy item from the player's inventory. Decide explicitly whether your server wants that separate behavior.

Buy the hard-copy license at City Hall

Current qb-cityhall filters available license documents against the player's metadata.licences table. Its server handler includes a weaponlicense document type and creates the item only after the configured City Hall checks and payment path succeed.

That means the usual flow is:

Police grants metadata permission
        ↓
metadata.licences.weapon = true
        ↓
City Hall exposes the weapon-license document
        ↓
Player purchases the hard-copy item

See qb-cityhall for resource-specific configuration.

Require the license in qb-shops

The current qb-shops/config.lua uses the string field requiredLicense:

{ name = 'weapon_pistol', price = 2500, amount = 5, requiredLicense = 'weapon' }

The current default weapons product list applies the same requirement to licensed ammunition and several pistols.

Do not copy the old Boolean key

Older documentation examples use requiresLicense = true. Current qb-shops uses requiredLicense = 'weapon'. Pin your configuration to the version you actually deploy.

Grant weapon permission to every new character

If your game design intentionally gives every new character permission, change the default in the core configuration/source used by your deployed revision so that:

weapon = true

Do this only if it matches your server rules. Existing characters already stored in the database may retain their existing metadata and therefore require a migration rather than merely changing a default.

Custom license types

The license table is extensible, but all participating resources must agree on the same string.

For example, if you introduce hunting:

PlayerData.metadata.licences.hunting = true

then police/admin issuance, City Hall documents, shops and any custom resource must all use exactly that key. Avoid inventing multiple spellings for the same permission.

Troubleshooting

SymptomCheck
/grantlicense is missingConfirm qb-policejob is installed, started and matches the documented revision.
Officer cannot grant itCheck police job, duty/grade logic and Config.LicenseRank.
City Hall does not show the documentInspect metadata.licences.weapon and the City Hall license config.
Player has the card but shop refuses purchaseA physical item is not the same as the metadata permission; inspect the current metadata and shop config.
Shop sells guns without a licenseAdd requiredLicense = 'weapon' to the products that should be restricted.
Old config stopped working after updateCompare requiresLicense = true with the current requiredLicense = 'weapon' schema.

Sources

Verified 2026-09-27.

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website