Skip to content

Configuration

Every option of Cuxial License: config file, live settings, jobs, badges, offices, photo studio, ID check and fake IDs.

Cuxial License reads its options from shared/config.lua and its offices from data/offices.lua. Card designs are not in any file: staff create them in game with /license.

Where each value comes from ​

Most sections can be edited live from the Settings, Jobs and factions and Offices sections of the /license panel. Those changes are saved in the database and reach every player at once.

SourceSectionsWhen it applies
shared/config.lua onlydebug, ui, admin, commands, issuing.defaultIdCard, photo.mapResource, photo.greenScreenPosOn resource restart
Database, editable in the paneljobs, documents, payment, showRadius, issuing, store, display, photo, idCheck, fakeIdAt once. display (keys and times) needs a restart
Database, editable in the panelOfficesAt once. data/offices.lua is only the first install

On the first start the script copies the values of shared/config.lua to the table cuxial_license_settings. From then on the database wins for the live sections.

After the first start, editing a live section in shared/config.lua is not enough. Restart the resource and press Factory on that section in Settings: it loads the values the file has at that moment. A badge faction you add to the file is the exception: it is added to the database on the next start.

The Settings section also exports and imports every section as JSON, to copy a setup from one server to another.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsetrue prints traces in the server and client console. The convar cuxial_license_debug 1 does the same.
ui.accentstring (hex)configurableAccent colour of every panel.
admin.permissionstring'admin'Framework permission needed to open /license and manage designs, issued documents, offices and settings. Checked through cuxial_bridge.
showRadiusnumber5.0Metres. Players inside it see the card you show, and are the ones listed as nearby in the issuing and ID check panels. Between 0.5 and 50.
payment.accountstring'cash'Account charged at the office store. 'cash' or 'bank'.

Commands · commands ​

OptionTypeDefaultWhat it does
license.namestring'license'Name of the staff command, without the slash.
checkLicense.namestring'checklicense'Name of the ID check command.
jobIssue.namestring'jobissue'Name of the issuing command.
*.restrictedboolean | stringfalsePassed to ox_lib. false lets anyone type the command; the script still checks the permission inside. true or a principal such as 'group.admin' also asks for the ACE command.<name>.

Jobs · jobs ​

Three tables of job name = minimum grade. The player needs that job with the grade shown or higher. The jobs in the file are examples: replace them with yours.

OptionDefaultWhat it does
authorizedpolice = 8, ambulance = 4, fib = 8Jobs that use /jobissue, issue cards, see nearby players and use /checklicense.
revokepolice = 8, fib = 8Jobs that revoke and restore in the issuing panel. Staff can always do it.
idCheckpolice = 0, fib = 0Extra jobs that only use /checklicense and the ID check panel.
shared/config.lua
lua
jobs = {
    authorized = { police = 2, sheriff = 2 },
    revoke = { police = 4 },
    idCheck = { police = 0, sheriff = 0 },
},

Each card also has its own list of jobs that can issue it, set in the designer (see Card options in the designer below).

The server exports for an MDT check that the job is listed in jobs.authorized or jobs.revoke, without looking at the grade. The MDT decides the rank.

Documents and badges · documents ​

OptionTypeDefaultWhat it does
idItemsstring[]{ 'id_card', 'cedula_id' }Items that count as an identity document. The exports report them with kind = 'id'; badge cards are 'badge' and any other card is 'license'.
badgestablethree factionsOne badge per faction. See the table below.
photoHostsstring[]Fivemanage addressesURL prefixes accepted as an external photo when an MDT issues a document. https only.
reasonMinnumber3Minimum characters of a revocation reason.
reasonMaxnumber200Maximum characters of a revocation reason. Up to 255.
revokeOnJobLossbooleantruetrue revokes the badge of a player who leaves the faction's job. false lets them keep it.

Each badge · documents.badges.<faction> ​

The file comes with police, ambulance and fib as examples, with neutral names and logos. Add, remove or rename factions to match your jobs.

OptionTypeWhat it does
itemstringItem of the badge. It must exist in your inventory.
jobsstring[]Jobs that carry this badge.
cardIdstring | falseCard design used for the badge. false takes the most recent design with the Badge size and this item.
shapestring'shield', 'round', 'star7', 'star6' or 'eagle'.
metalstring'gold', 'silver', 'bronze', 'chrome', 'black', 'graphite', 'navy-silver' or 'navy-gold'.
ribbon.top / ribbon.bottomstringCurved text above and below the badge. {callsign} is replaced by the holder's badge number.
logostringImage in the centre of the badge: a path inside web/build (image/…) or an https link.
presetstringFactory design of the wallet card, used while the badge card has no design of its own.
rankstablegrade = { insignia = '…', label = '…' }. Insignia: 'bars1' to 'bars3', 'star1' to 'star5' or 'eagle'. label is optional. {} shows no insignia.
shared/config.lua
lua
sheriff = {
    item = 'sheriff_badge', jobs = { 'sheriff' }, cardId = false,
    shape = 'star7', metal = 'gold',
    ribbon = { top = 'SHERIFF', bottom = '{callsign}' },
    logo = 'image/brand/police.webp',
    ranks = {
        ['0'] = { insignia = 'bars1' },
        ['4'] = { insignia = 'star1', label = 'Sergeant' },
    },
},

The badge itself is a card design with the Badge size and the faction's item, created in /license. An MDT hands it out with IssueBadge.

Issuing · issuing ​

OptionTypeDefaultWhat it does
photoTimeoutnumber60Seconds the player has to accept a request from /jobissue and take the photo. Between 10 and 600.
defaultItemstring'id_card'Item handed out for a card design with no item name.
presetstableid_card → factory ID designitem = factory design. Draws the card of that item with a factory design while its card has no design of its own.
defaultIdCardtable | false{ item = 'id_card', heading = 'Documento de identidad', price = 50 }On start, creates an ID card design with this item, title and office fee if no design uses the item yet. false creates nothing. Only in the file.

The item of defaultIdCard must exist in your inventory before the first start. If it does not, the console shows an error and the design is not created.

Store · store ​

OptionTypeDefaultWhat it does
maxPerPurchasenumber5Cards a player can buy in one purchase. Between 1 and 20.
sessionTimeoutnumber300Seconds an open purchase lasts, from payment to photo. At least 30.

Showing a card · display ​

Changes to this section need a resource restart.

OptionTypeDefaultWhat it does
hideKeystring'E'Default key to put the card away.
flipKeystring'G'Default key to flip the card and see the back.
durationnumber30Maximum seconds your own card stays on screen.
nearbyDurationnumber5Seconds nearby players see it.
showCooldownnumber3Seconds between two uses of a card.

Each player can rebind both keys in the GTA settings, under Key Bindings → FiveM.

Photo studio · photo ​

During the photo the player is moved to the studio, alone in their own routing bucket, and returned to where they were.

OptionTypeDefaultWhat it does
enabledbooleantruefalse issues and sells cards with no photo session and no photo.
signaturebooleantruetrue asks for a signature after the photo; if the player skips it, the name is written in a handwritten font. false asks for none.
mapResourcestring'cuxial_license_map'Resource of the green-screen studio. If it is not started, the photo session does not open. Only in the file.
camOffsetvector3vec3(0.0, 0.7, 0.65)Starting frame. z is the height of the point the camera looks at; y plus 0.5 is the starting distance in metres.
fovnumber36.0Field of view of the camera. Lower values zoom in.
greenScreenPosvector4inside the studioWhere the player stands for the photo. Only in the file.
waitTimeoutnumber8000Maximum milliseconds of each wait during the transfer (fade, collision).
maxSessionnumber300Maximum seconds with the camera on before the player is sent back.
bucketBasenumber64000Routing bucket of the photo = this value + the player's server id. Change it if another resource uses that range.
maxUploadSizenumber4000000Maximum size of a photo, in base64 characters.
uploadCooldownnumber3Seconds between two uploads of the same player.
captureCooldownnumber2Seconds between two captures of the same player.

Only change greenScreenPos if you move the photo to a green-screen room of your own. The background is removed by colour, so a place without a green backdrop gives a photo with its scenery.

ID check · idCheck ​

OptionTypeDefaultWhat it does
logostring'image/default.png'Image of the panel. Path inside web/build.
titlestring'Los Santos Police Department'Title of the panel.
refreshIntervalnumber3000Milliseconds between refreshes of the nearby player list while the panel is open.

Fake IDs · fakeId ​

OptionTypeDefaultWhat it does
enabledbooleanfalsetrue turns the generator on. Create the item first.
itemNamestring'fake_id'Item given to the player, with export = 'cuxial_license.useFakeId'.
jobsstring[]{}Jobs that can use the generator. {} = anyone.
requiredItemstring | falsefalseItem consumed for each document. false = none.
pricenumber5000Cost of each document. 0 = free.
accountstring'cash'Account charged: 'cash', 'bank' or 'black_money'.
cooldownnumber300Seconds between two documents of the same player.
sessionTimeoutnumber300Seconds the panel stays valid once opened.

The generator has no command and no NPC. Open it from your own resource with openFakeId, for example from a hidden location.

Offices · data/offices.lua ​

Each office spawns an NPC that sells a list of cards. The file is read once, while the offices table is empty; after that, edit the offices in the Offices section of /license, where you can also place the NPC at your position.

OptionTypeWhat it does
idstringUnique id: lowercase letters, numbers and _, up to 32 characters.
labelstringName of the office, shown on the NPC and in the store.
enabledbooleanfalse hides the office.
coordstable{ x, y, z, w }. w is the heading of the NPC.
modelstringPed model.
usePlayerSkinbooleantrue dresses the NPC as the player. Works with cuxial_interactions.
scenariostringScenario the NPC plays, such as 'WORLD_HUMAN_CLIPBOARD'. Optional.
distancenumberMetres at which the NPC spawns. Between 5 and 100.
bliptableenabled, sprite, color, scale and an optional label.
dialogtablename, greeting and howItWorks: texts of the NPC conversation with cuxial_interactions. Empty = default texts.
itemsstring[]The office sells every card design that hands out one of these items.
jobsstring[]Only these jobs see the office. {} = everyone.
hourstable{ from = 8, to = 20 } in game hours. Outside that range the office is closed. Omit it, or use the same hour twice, to keep it always open.

The file comes with a city hall office enabled and two disabled examples. Change their positions, names and texts to fit your server.

data/offices.lua
lua
{
    id = 'cityhall',
    label = 'City Hall',
    enabled = true,
    coords = { x = 316.34, y = -225.12, z = 54.08, w = 160.0 },
    model = 's_m_y_cop_01',
    scenario = 'WORLD_HUMAN_CLIPBOARD',
    distance = 30,
    blip = { enabled = true, sprite = 498, color = 0, scale = 0.7 },
    dialog = { name = 'Alex', greeting = 'Good morning.', howItWorks = 'Pick a document, pay and smile.' },
    items = { 'id_card' },
    jobs = {},
    hours = { from = 8, to = 20 },
},

The office hour comes from av_weather or prim_climatime when one of them is running, and from the game clock otherwise.

Card options in the designer ​

Each card design carries its own options. The designer has three tabs: Design (size, layers, front and back), Data (name, custom fields) and Rules.

OptionTabWhat it does
ActiveRulesTurned off, the card leaves the store and issuing without being deleted.
Restrict to job and its jobsRulesTakes the card out of the store. If the card has no issuing jobs, only these jobs can issue it.
Jobs that can issueRulesJobs that can hand this card to other players. Empty = any job in jobs.authorized.
Charge money and priceRulesPrice at the store. A card without it is free at an office and does not appear in a store opened without an office.
Item nameRulesItem handed out. Empty = issuing.defaultItem. Check confirms the item exists, and the designer shows the definition ready to copy.
RequirementsRulesThe store only offers the card to players who hold the marked documents (valid, not revoked or expired), have one of the jobs and carry the item. All optional.
Custom fieldsDataUp to 12 fields (text, list, date or number) filled by whoever issues the card. In the design, use them as custom:<key>.

Texts in the design take the holder's data in braces, such as {first_name}, {birthdate}, {rank} or {callsign}. A design can be saved as a Template and reused on other cards.

Deleting a card design also deletes every document issued from it. The items stay in the inventories but no longer show anything. To retire a card, turn Active off instead.

Common changes ​

Charge the bank account at the store

lua
payment = { account = 'bank' },

Let a lower rank issue cards

lua
jobs = {
    authorized = { police = 1 },
    revoke = { police = 4 },
    idCheck = { police = 0 },
},

Turn on fake IDs for one job, paid with dirty money

lua
fakeId = {
    enabled = true,
    itemName = 'fake_id',
    jobs = { 'forger' },
    requiredItem = false,
    price = 2500,
    account = 'black_money',
    cooldown = 300,
    sessionTimeout = 300,
},

After the first start, make these changes in the panel, or restart and press Factory on that section.

© Cuxial