Cuxial License ships as two resources, the script and its photo studio map. It needs screencapture for the photos, a few inventory items and one convar, and creates its own database tables on start.
Check the dependencies
These resources must be installed and working before you add the script:
ox_liboxmysqlcuxial_bridge, with QBox or QBCoreox_inventory, to use the cards as itemsscreencapture(next step)
Optional:
cuxial_interactions: the office NPC talks with a dialog (greeting, how it works). Without it, the NPC has a target option that opens the store, through a target resource supported by the bridge (sleepless_interact,ox_targetorqb-target).cuxial_police: the card shown carries the wanted and dangerous marks of the character.av_weather: drives the time-of-day selector of the photo session and, withprim_climatimeas an alternative, the clock of the office hours.
Install screencapture
screencapture is a free, open-source resource that takes a screenshot of a player's game. Cuxial License uses it for the photo printed on each card, and will not start without it.
- Download the latest release from github.com/itschip/screencapture. Take the packaged release, not the source code: the resource must contain the
game/distfolder. - Place the folder in your
resourcesdirectory and keep its name asscreencapture. - Start it before Cuxial License.
screencapture declares itself as a replacement for screenshot-basic, so resources that depend on that one keep working with it. It runs on Node 22: use a recent server artifact.
Copy the resources
The package contains two folders. Place both inside your resources directory:
| Folder | What it is |
|---|---|
cuxial_license | The script |
cuxial_license_map | The green-screen studio where photos are taken |
Keep the folder name cuxial_license. The inventory items call the script by that exact name and stop working if you rename it. If you rename cuxial_license_map, set the new name in photo.mapResource.
Database
Nothing to import. On start the resource creates its six tables and brings older ones up to date:
| Table | Holds |
|---|---|
cuxial_cards | Card designs |
cuxial_issued | Issued documents |
cuxial_license_settings | Settings edited in the panel |
cuxial_license_offices | Offices |
cuxial_license_templates | Design templates |
cuxial_license_audit | Log of staff actions |
If your database user cannot create or alter tables, run sql/install.sql by hand once.
Updating from 2.x. Back up the database, then replace the resource folder. The resource applies sql/migrate_2_1_0.sql, migrate_2_2_0.sql and migrate_3_0_0.sql on its own; they are included to run by hand if your user lacks permissions, in that order. Cards made in 2.x keep working and show a Convert to v3 button in the designer to edit them by layers. The config file changed shape: start from the new shared/config.lua and copy your values into it (authorizedJobs is now jobs.authorized, revokeJobs is jobs.revoke, paymentType is payment.account, theme.color is ui.accent, and the offices moved to data/offices.lua).
Add the items
Add the items you use to ox_inventory/data/items.lua. Every document and badge item uses useLicenseCard.
['id_card'] = {
label = 'ID card',
weight = 5,
stack = false,
close = true,
consume = 0,
description = 'Identity document',
client = { export = 'cuxial_license.useLicenseCard' },
},| Item | When you need it |
|---|---|
id_card | Always. It is the default item (issuing.defaultItem) and the one of the ID card created on first start (issuing.defaultIdCard). Add it before starting the script. |
| Badge items | One per faction in documents.badges. The example file uses licencia_policial, ems_badge and fib_badge; rename them to yours. |
| Any item name typed in the designer | Each one needs its own definition with useLicenseCard. The designer checks it and shows the block ready to copy. |
fake_id | Only with fakeId.enabled = true. Uses export = 'cuxial_license.useFakeId'. |
job_badge, worker_id | Only if another resource of yours hands them out (see Exports & events). They use useJobBadge and useWorkerId. |
['fake_id'] = {
label = 'ID card',
weight = 5,
stack = false,
close = true,
consume = 0,
client = { export = 'cuxial_license.useFakeId' },
},stack = false is required. Every card stores its own data, so two cards can never share a slot.
Item images are not included. Add your own to ox_inventory/web/images/ with the item name (id_card.png, fake_id.png…).
Set the convars
# Fivemanage token used to store the photos
set cuxial:fivemanageToken "YOUR_FIVEMANAGE_TOKEN"
# Language (en and es are included)
setr ox:locale "en"The photo is uploaded to your Fivemanage account and the card keeps its link. Without a token the photo session still opens, but the upload fails and the card is issued without a photo.
The photo is uploaded from the server. Write the token with set, not setr: it stays on the server and is never sent to the players.
Start the resources
Start them after their dependencies, your framework and your inventory:
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core or qb-core)
ensure ox_inventory
ensure ox_target
ensure cuxial_bridge
ensure screencapture
# optional
ensure cuxial_interactions
ensure cuxial_police
ensure cuxial_license_map
ensure cuxial_licenseReplace the framework and target lines with the ones your server uses.
Check that it works
- The server console shows the factory ID card and the factory offices being installed on the first start.
- Join with an account that has the
adminpermission of your framework and type/license. The panel opens. - Go to the city hall office (see Offices in the panel) and buy the ID card. The photo studio opens.
- Capture, sign and submit. The item appears in your inventory.
- Use the item. The card shows on screen with your photo; G flips it and E puts it away.
Next: set the jobs, badges, offices and studio in Configuration.
