Browse docs
Documents
Choose an export
| I want to… | Client export | Whose screen? |
|---|---|---|
| Look at my own document | ViewOwnDocument | Mine |
| Inspect another player's document | InspectPlayerDocument | Mine |
| Show my document to one player | PresentOwnDocumentToPlayer | The selected player's |
| Show my document to everyone nearby | PresentOwnDocumentNearby | Nearby players'; mine too with includeSelf = true |
Use Sky Jobs Base 1.56.0 or newer. Call these exports from a client event, command
handler or thread after Jobs Base has started. The calls yield while Jobs Base handles the request.
Use "identity" for an ID card, "licenses" for held licenses, or "service" for a service ID.
Show my ID to everyone nearby and myself for five seconds
local success, openedCount, reason = exports["sky_jobs_base"]:PresentOwnDocumentNearby("identity", {
includeSelf = true,
durationMs = 5000,
})
if not success then
print(("Could not show ID: %s"):format(reason or "unavailable"))
end
ViewOwnDocument(documentType, options?)
Opens your own document on your screen. You do not need a job inspection permission.
local success, reason = exports["sky_jobs_base"]:ViewOwnDocument("licenses")
InspectPlayerDocument(documentType, targetServerId, options?)
Opens another player's document on your screen. Pass the selected player's positive integer
server ID. The inspection requires the corresponding identity or licenses permission,
including job, grade and duty requirements. The target must be restrained by Jobs Base
(handcuffs or zip ties), within 2.5 metres, and in the same routing bucket. Service IDs use
the identity permission. Use ViewOwnDocument for your own character.
local success, reason = exports["sky_jobs_base"]:InspectPlayerDocument("identity", targetServerId)
PresentOwnDocumentToPlayer(documentType, recipientServerId, options?)
Opens your document on one selected player's screen. Pass their positive integer server ID. You must be within 2.5 metres of the recipient, in the same routing bucket, and free of restraints. The recipient needs their screen free of other focused menus. No job inspection permission is required. The radial also offers this under Player interactions → Documents.
local success, reason = exports["sky_jobs_base"]:PresentOwnDocumentToPlayer("service", recipientServerId, {
durationMs = 8000,
})
PresentOwnDocumentNearby(documentType, options?)
Opens your document on eligible nearby players' screens. The server picks the recipients
in your routing bucket. The same presentation rules apply as for one recipient. Players
with another focused menu are skipped. Set includeSelf = true to include your own screen;
this also works when you're alone. Presenting a document does not transfer an item.
| Option | What it does | Default |
|---|---|---|
includeSelf | Also open the card on your screen. Must be a boolean. | false |
radius | Distance in metres. Must be greater than 0 and at most 2.5. | 2.5 |
durationMs | How long the card stays open on each screen, in milliseconds. | 60000 |
Display duration and external card providers
All four exports accept { durationMs = 5000 } as the last argument. Use a whole number
from 1000 to 60000. The timer starts when Jobs Base opens the card on each viewer's
screen. The viewer can still close it early with Enter or Escape.
Presentation always uses the shared Jobs Base card. For self views and inspections,
passing durationMs also selects the shared card so Jobs Base can close it on time.
Omit the option to keep your configured card provider. The shared card then closes after
60 seconds; external providers manage their own closing behaviour.
Return values
ViewOwnDocument, InspectPlayerDocument and PresentOwnDocumentToPlayer return
success, reason. PresentOwnDocumentNearby returns success, openedCount, reason.
For a nearby presentation, success is true if at least one card opened. The count includes
your own screen when it opened with includeSelf = true. If no card opens, the count is 0
and reason describes a failed check or delivery.
| Reason | Meaning |
|---|---|
invalid_document_type | Use identity, licenses or service. |
invalid_options | Pass a table for options and a boolean for includeSelf. |
invalid_duration | Pass a whole number from 1000 to 60000 for durationMs. |
invalid_radius | Pass a radius greater than 0 and at most 2.5. |
invalid_target | The server ID is invalid or has no loaded character, or you passed your own ID instead of using the self option. |
no_recipients | No players with a loaded character were within range for the nearby request. |
busy | A viewer has another focused menu, an offer is pending, or the request was rate limited. |
too_far | A player was outside the permitted range or routing bucket, or had no usable ped. |
restrained | You cannot present a document while restrained. |
target_not_restrained | Inspection requires the target to be restrained by Jobs Base. |
not_authorized | An inspection or character check failed. |
disabled | The relevant document feature is disabled. |
storage | Jobs Base could not read or store service ID settings or numbers. Check the service card tables and oxmysql. |
unavailable | The document or provider could not complete the request. |
Access and provider hooks can return additional reasons. For an external card, true means
the provider handoff was accepted; the provider controls what appears on screen.
Legacy exports
Existing scripts can keep using these names with their original arguments:
| Legacy export | Same action as |
|---|---|
ShowOwnDocument(documentType) | ViewOwnDocument: look at your own document on your screen. |
ShowPlayerDocument(documentType, targetServerId) | InspectPlayerDocument: inspect the selected player's document on your screen. |
PresentOwnDocument(documentType, recipientServerId) | PresentOwnDocumentToPlayer: show your own document on the recipient's screen. |
After importing Jobs Base, these client functions are also available on Sky_Jobs, for example
Sky_Jobs.ViewOwnDocument("identity").
See Player Documents for card settings and
Service IDs and Numbers for service ID setup.