Skip to main content
A document is two things: one item in your inventory and one entry in Config.Documents (config/documents.lua). This page builds two examples from scratch:
  • a hunting licence, a license document issued at a citizen office
  • a fire department badge, a badge document for the job fire
The same steps work for any other card. For what the three kinds mean in the register, see Documents and register.

Pick the kind

Step by step

1

Make sure the licence exists (license only)

The licence type must be a row of the esx_license licenses table. If no other script adds it, add it yourself:
If it is missing, the console prints 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.
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 }
Restart 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

Add the type to the documents of an office and give it its fees in Config.Offices (config/office.lua), or on the office page of /documents config:
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 identity document can also go to every new character: add the type to Config.Starter.documents. See Citizen offices.
5

Restart and test

Restart jksm_identity, then in game:
Use the item to look at it, and check it with /documents check <serial>.

The look of the card

Every field of theme 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.
The rank on a badge is the job grade label of the owner when it was issued.

Forging it

A custom document can be forged like the shipped ones. Which forger level may forge it depends on its kind, in Config.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.