Browse docs
Shared Job APIs
Creator jobs use sky_jobs_base for shared gameplay. Call the owner named in each reference; adding sky_jobcreator to an export name does not expose another copy of the API.
Read a player's job
Server · sky_jobs_base. getPlayerJobInfo(playerId) takes an online player's numeric server ID. It returns { job, grade, gradeLabel, onDuty }, or nil when the player is invalid or not loaded.
-- player_source is the actual source of your authorized server request.
local info = exports["sky_jobs_base"]:getPlayerJobInfo(player_source)
if not info then
print("Job lookup failed: the player is not loaded")
return
end
print(info.job, info.grade, info.gradeLabel, info.onDuty)
job is the technical job key, not its display label. Keep real grade numbers, including gaps; a grade is not an array position. Resolve current identity, job and duty on the server rather than trusting a client copy.
Duty
Server · sky_jobs_base. setPlayerDuty(playerId, onDuty) takes a numeric player server ID and an explicit boolean. It returns whether the resulting cached duty state matches the requested state. It uses the shared duty pipeline; it does not create a duty-capable job or grant your caller permission.
-- Run only after your integration has authorized this change.
local changed = exports["sky_jobs_base"]:setPlayerDuty(player_source, false)
if not changed then
print("The requested duty state could not be applied")
end
See Duty for isPlayerOnDuty and getOnDutyPlayers.
Feature references
| Feature | API reference |
|---|---|
| Employee membership, hiring and grade changes | Players & Members |
| Rank and management permissions | Permissions |
| Work-time salary controls | Salary |
| Society balances and money changes | Society Money |
| Invoice creation and confirmed payment events | Billing |
| Business status and announcements | Business server API and client API |
| Shared job inventory | Storage server API and client API |
| Vehicles spawned by an external garage | External Garage Integration |
| Radial actions and player interactions | Radial Menu and Player Interactions |
| Documents and tablet integrations | Jobs Base client exports |
| Shared library startup | Library and Startup |
A shared API being available does not enable every feature for every job. The job's saved feature settings, provider, permissions, duty and resource exclusions still apply. Generic Creator jobs do not gain specialized Police, Ambulance, Mechanic, Fire, Crime or DOJ gameplay by calling a shared export.
Job definitions and gameplay configuration have different owners. Use the Creator administration workflow to create/edit framework definitions, and its shared configuration sections for locations and feature settings. Employee and duty exports operate on the existing job; they do not create or configure that job.