Browse docs
Client Exports
Client-side exports provided by sky_jobs_base for radial menu, dispatch, and storage interactions.
Radial Menu
openRadialMenu()
- Purpose: Opens the job radial menu as if the player pressed the configured hotkey.
exports["sky_jobs_base"]:openRadialMenu()
getRadialActions()
- Purpose: Returns all available radial menu actions with their metadata.
- Returns:
RadialAction[]— array of action objects withid,label,icon,disabled, and more.
local actions = exports["sky_jobs_base"]:getRadialActions()
for _, action in ipairs(actions) do
print(action.id, action.label, action.disabled)
end
getRadialAction(actionId)
- Purpose: Fetches a single radial action by its ID.
- Arguments:
actionId(string) — the action identifier.
- Returns:
table | nil— the action object, ornilif not found.
local action = exports["sky_jobs_base"]:getRadialAction("stretcher_carry")
isRadialMenuActionAvailable(actionId)
- Purpose: Checks if a radial action exists and is currently enabled.
- Arguments:
actionId(string)
- Returns:
boolean—truewhen the action exists and is not disabled.
if exports["sky_jobs_base"]:isRadialMenuActionAvailable("treat_patient") then
-- Action is available
end
triggerRadialMenuAction(actionId)
- Purpose: Executes a radial action handler without opening the UI.
- Arguments:
actionId(string)
- Returns:
boolean—trueon success,falseon failure.table?— on failure, a table withkey(locale key) andfallback(error message).
local success, err = exports["sky_jobs_base"]:triggerRadialMenuAction("treat_patient")
if not success then
print("Failed:", err.fallback)
end
Built-in Actions
These actions are registered by sky_jobs_base itself. Job scripts (like sky_ambulancejob) add their own actions on top.
| Action ID | Description |
|---|---|
tablet | Opens the tablet interface. |
remove_trunk_prop | Removes a nearby placed trunk prop. |
Dispatch
createDispatch(title, message, coords, jobs, meta)
- Purpose: Sends a dispatch alert to on-duty members of the specified jobs. Client-side wrapper that triggers the server event.
- Arguments:
title(string) — dispatch title.message(string) — dispatch description.coords(vector3) — location of the incident.jobs(string | string[]) — job name or array of job names to notify.meta(table?) — optional metadata:source(number?) — source player ID.sourceId(string?) — additional source identifier.category(string?) — dispatch category.
- Returns:
boolean— alwaystrue(server validates asynchronously).
exports["sky_jobs_base"]:createDispatch(
"Traffic Accident",
"Vehicle collision on Route 68",
vector3(1234.0, -567.0, 30.0),
{ "ambulance", "police" },
{ category = "accident" }
)
Storage
getNearbyTrunkPropTarget(maxDistance)
- Purpose: Finds the nearest managed trunk prop within the given distance.
- Arguments:
maxDistance(number) — search radius in game units.
- Returns:
table | nildistance(number) — distance to the prop.label(string) — display label.
local target = exports["sky_jobs_base"]:getNearbyTrunkPropTarget(5.0)
if target then
print(target.label, target.distance)
end
removeNearbyTrunkProp(maxDistance)
- Purpose: Removes the nearest managed trunk prop.
- Arguments:
maxDistance(number) — search radius.
- Returns:
boolean—trueon success.string?— on failure, a locale key describing the error.
local success, errorKey = exports["sky_jobs_base"]:removeNearbyTrunkProp(5.0)
if not success then
print("Failed:", errorKey)
end
Support
Need help? Our support team is always ready to assist
Join Discord