Browse docs
Server Exports
Server-side exports provided by sky_jobs_base for dispatch, tablet app registration, and more.
Dispatch
createDispatch(title, message, coords, jobs, meta)
- Purpose: Creates a dispatch entry and broadcasts it to all on-duty members of the target jobs.
- Arguments:
title(string) — dispatch title. Required.message(string) — dispatch description.coords(vector3 | table) — location{x, y, z}. Required.jobs(string | string[]) — job name or array of job names.meta(table?) — optional metadata:source(number?) — source player ID.sourceId(string?) — additional source identifier.category(string?) — dispatch category.
- Returns:
table | nil— the dispatch entry on success,nilon validation failure.
local dispatch = exports["sky_jobs_base"]:createDispatch(
"Bank Robbery",
"Silent alarm triggered at Pacific Standard",
vector3(235.0, 216.0, 106.0),
{ "police" },
{ category = "robbery", source = source }
)
if dispatch then
print("Dispatch created:", dispatch.id)
end
Dispatch Entry Structure
| Field | Type | Description |
|---|---|---|
id | string | Unique dispatch identifier |
title | string | Dispatch title |
message | string | Dispatch description |
coords | table | Location {x, y, z} |
jobs | table | Target job names |
status | string | "active" on creation |
createdAt | number | Timestamp |
HasDispatch(sourceKey, sourceId)
- Purpose: Checks if an active dispatch exists for the given source.
- Arguments:
sourceKey(string) — source identifier key.sourceId(string) — source ID value.
- Returns:
boolean—trueif a non-done dispatch exists.
local exists = exports["sky_jobs_base"]:HasDispatch("player", "license:abc123")
if exists then
print("Active dispatch already exists")
end
Gallery
takeServerImage(rawDataUrl, cameraMetadata)
- Purpose: Uploads a base64 image to the configured image provider.
- Arguments:
rawDataUrl(string) — base64-encoded image data URL.cameraMetadata(table) — metadata about the camera/capture context.
- Returns:
boolean—trueon success,falseon failure.table | string— on success:{ data = { url, id, image_id } }. On failure: error message.
local ok, result = exports["sky_jobs_base"]:takeServerImage(imageData, {
type = "bodycam",
timestamp = os.time()
})
if ok then
print("Uploaded:", result.data.url)
end
Support
Need help? Our support team is always ready to assist
Join Discord