Browse docs

Documents

Client exports for viewing your own documents and inspecting a selected player's identity, licenses or service ID.

Document views

These client-only exports belong to the new document-card update. Supported types are exactly identity, licenses and service. They show a document on the calling player's screen, rather than sending it to the target or broadcasting it to nearby players.

Jobs Base must have finished starting. Call from a client event, command handler or thread that can yield while the server request completes.

ShowOwnDocument(documentType)

Shows the calling player's own card. The server selects the authenticated requesting character; no supplied target ID or identity fields can replace that owner. No job inspection grant is required for your own card.

local success, reason = exports["sky_jobs_base"]:ShowOwnDocument("identity")

For your own license view, pass "licenses" to ShowOwnDocument instead. For your department service ID, pass "service". Close the current card before opening another one.

ShowPlayerDocument(documentType, targetServerId)

Inspects another player's identity, licenses or service ID. targetServerId must be a positive integer server ID, not a player index or ped handle. Use ShowOwnDocument for your own character.

local targetServerId = 12 -- Resolve your selected player's server ID.
local success, reason = exports["sky_jobs_base"]:ShowPlayerDocument("identity", targetServerId)

The actor needs the corresponding identity or licenses inspection permission, with the existing job, grade and duty rules. The server checks a maximum distance of 2.5 metres, matching routing buckets and unchanged character identity after provider work. Calling an export does not grant access. Service-ID inspection uses the identity permission. The holder must have an employment job; number allocation requires the new service-card tables and oxmysql.

Return values

Both return success, reason?:

ResultMeaning
trueShared-view opening was accepted, or an authorized native-provider handoff was accepted. It does not prove that an external provider rendered its UI.
false, "invalid_document_type"Type is not identity, licenses or service.
false, "storage"Service settings or number allocation could not be stored/read. Check the new tables and oxmysql.
false, "invalid_target"Invalid target, changed character, or your own ID supplied to ShowPlayerDocument.
false, "busy"Another NUI view has focus, or the request is rate-limited.
false, "not_authorized"Inspection permission or character binding failed.
false, "too_far"Target is too far away, in another routing bucket, or has no usable ped.
false, "unavailable"Request or configured provider could not supply the document.

Access and custom-provider hooks can return their own existing failure reason. Handle failed requests explicitly instead of treating them as empty or successful cards.

RegisterCommand("myidentity", function()
    local success, reason = exports["sky_jobs_base"]:ShowOwnDocument("identity")
    if not success then
        print(("Document view failed: %s"):format(reason or "unavailable"))
    end
end, false)

After importing Jobs Base, the same client APIs are available as Sky_Jobs.ShowOwnDocument(documentType) and Sky_Jobs.ShowPlayerDocument(documentType, targetServerId).

Shared cards close with Return / Enter, Escape, or after 60 seconds. External providers retain their own interface and closing behaviour. See Player Documents for editable templates, position, size, optional branding and native integrations.