Config.Documents (config/documents.lua). This page builds two examples from scratch:
- a hunting licence, a
licensedocument issued at a citizen office - a fire department badge, a
badgedocument for the jobfire
Pick the kind
Step by step
1
Make sure the licence exists (license only)
- ESX
- QBCore / Qbox
The licence type must be a row of the esx_license If it is missing, the console prints
licenses table. If no other script adds it, add it yourself:hunting: licence type "hunting" is not in the licenses table on start.2
Add the item
The item name is free, it only has to match
item in the next step. Give it an image named after the item (for example hunting_license.webp) in your inventory’s image folder.- jaksam_inventory
- ox_inventory
- qb-inventory
Add it to
jaksam_inventory_data/items.lua. type = 'idcards' gives it the right-click actions View, Show and Copy number, onUse hands it to the script and dynamicMetadata fills a document that comes from a shop or an admin give:- A licence with classes also needs
classes = { metadataTemplateId = 'doc_classes', onlyFirstAdd = true } - A badge also needs
rank = { metadataTemplateId = 'doc_rank', onlyFirstAdd = true }
jaksam_inventory once.3
Add the document type
One entry in
Config.Documents. The key (hunting, badge_fd) is the document type: it is stored in the register and used by the offices, the commands and the exports. Do not rename it once documents of that type exist.4
Decide who issues it
- identity / license
- badge
Add the type to the Without an office that lists it, the document exists but no counter hands it out. A licence is only issued to characters who hold it: the office does not grant it.An
documents of an office and give it its fees in Config.Offices (config/office.lua), or on the office page of /documents config:identity document can also go to every new character: add the type to Config.Starter.documents. See Citizen offices.5
Restart and test
Restart Use the item to look at it, and check it with
jksm_identity, then in game:/documents check <serial>.The look of the card
Every field oftheme is optional.
Colours are hex values (
#1d4e89). Keep secondary light and primary dark: the data is printed in dark text on the background, the bands have white text.
Forging it
A custom document can be forged like the shipped ones. Which forger level may forge it depends on its kind, inConfig.Forging.levels (config/forgery.lua): out of the box ID cards from the first level, licences from the second and badges from the fourth. See Forging.