SMX logo

SMX Documentation

Production-grade Script Knowledge Base

Build 2026.04 Live Docs



License

Free Scripts · FiveM Ready

Exports

This resource does not expose custom public exports. Integration should be done through commands, events and framework callbacks listed below.

Note: The code uses framework exports internally (for example qb-core / es_extended shared object access), but no custom exports('...') API is provided by smx-license itself.

Server Events (Receive)

Saves or updates the player's mugshot image data in smx_license_mugshots.

smx-license:server:saveMugshot

Payload: mugshot (string data URL/base64). Includes size and validation checks before DB write.

Opens a selected document card for self or a target viewer.

smx-license:server:showCard

Payload: cardType, targetPlayer. Checks ownership, confiscation state, and job-based document access.

Executes authority actions such as inspect ID, confiscate document, and issue document.

smx-license:server:jobAction

Payload object: action, targetId, docType, company, reason. Validates permissions, distance, and per-document rules.

Server Callbacks

Returns documents of a target that can currently be confiscated by the requesting authority player.

smx-license:server:getTargetConfiscatableDocs

Input: targetId. Output: { ok, docs[] } with ownership/confiscation filtering.

Returns documents of a target that can be issued by the requesting authority player.

smx-license:server:getTargetIssuableDocs

Input: targetId. Output: { ok, docs[] } with job and action permission checks.

Returns full menu payload for the requesting player, including visible documents and authority capabilities.

smx-license:server:getMenuData

Output includes canManage, allowedActions, hasMugshot, and normalized document list.

Client Events (Receive)

Client notification bridge used by server-side Config.Notify in duplicity context.

smx-license:client:notify

Args: type, title, message, time. Forwards to local notification provider adapter.

Opens the visual document card NUI with prepared identity/document payload.

smx-license:client:openCard

Args: cardType, data. Can auto-close menu first depending on Config.CloseMenuOnDocumentOpen.

NUI Callbacks (Receive from UI)

Closes active document view.

close

Sets card state to closed and removes focus.

Closes menu panel.

menuClose

Sets menu state to closed and removes focus if no card is open.

Re-fetches menu payload from server.

menuRefresh

Uses callback smx-license:server:getMenuData and refreshes UI state.

Starts mugshot capture flow.

menuCaptureMugshot

Captures ped headshot and forwards encoded image to server.

Returns converted mugshot image from UI conversion step.

mugshotAnswer

Resolves pending promise by requestId and cleans headshot handle.

Shows selected document to self or nearby target.

menuShowDocument

Payload: docType and targetMode (self/nearby).

Opens player picker for authority action context.

menuOpenPlayerPicker

Provides players in 5m range, including optional test NPC entry.

Fetches target docs eligible for confiscation.

menuFetchTargetDocuments

Calls server callback smx-license:server:getTargetConfiscatableDocs.

Fetches target docs eligible for issuing.

menuFetchTargetIssuableDocs

Calls server callback smx-license:server:getTargetIssuableDocs.

Legacy alias path for opening authority picker.

menuJobAction

Keeps compatibility with older cached frontend builds.

Executes authority action selected in picker.

menuExecuteJobAction

Sends final payload to smx-license:server:jobAction.

Commands

Open document menu.

/docmenu

Primary command for personal + authority tabs.

Alias command for document menu.

/documents

Same behavior as /docmenu.

German alias for document menu.

/dokumente

Same behavior as /docmenu.

Captures and stores your mugshot image.

/docmugshot

Useful for identity cards with portrait display.

Admin command to add a license to a target player.

/addlicense [id] [license] [company (business only)]

Permission-gated by Config.AdminGroups or QB admin permissions.

Admin command to remove a license from a target player.

/removelicense [id] [license]

Also removes business metadata if license type is business.

Dynamic document commands generated from Config.Documents.

/{docCommand}
/show{docCommand}

Example with default config: /id, /showid, /driver, /showdriver.