Browse docs
Server exports
All calls on this page run in a server script and use exports["sky_jobs_base"]. playerId means the online player's numeric server ID. jobName means the technical job name, such as sunrise_cafe.
Job and duty
| Export | Arguments | Returns |
|---|---|---|
getPlayerJobInfo(playerId) | Player server ID | { job, grade, gradeLabel, onDuty }, or nil if unavailable |
isPlayerOnDuty(playerId) | Player server ID | boolean; false when off duty or not loaded |
getOnDutyPlayers(jobName) | Technical job name | Array of on-duty player server IDs |
setPlayerDuty(playerId, onDuty) | Player server ID and true / false | Whether the resulting duty state matches the request |
For example, restrict an external activity to on-duty cafe employees:
local job = exports["sky_jobs_base"]:getPlayerJobInfo(playerId)
if not job or job.job ~= "sunrise_cafe" or not job.onDuty then
return
end
-- Continue your cafe-only action here.
Set duty from your own authorised clock-in or clock-out workflow:
local changed = exports["sky_jobs_base"]:setPlayerDuty(playerId, true) -- On duty
-- Pass false to clock out.
if not changed then
print("The requested duty state could not be applied")
end
Use the authenticated player's server ID. See Duty for the complete reference.
Employees
| Export | Arguments | Returns |
|---|---|---|
setJobMember(jobName, playerOrIdentifier, grade?) | Job, online server ID or offline character identifier, optional grade | success, error? |
removeJobMember(jobName, playerOrIdentifier) | Job and online server ID or offline character identifier | success, error? |
getJobMembers(jobName) | Technical job name | Array of employee records |
setJobMember hires a player or changes an existing employee's grade. If the grade is omitted, it uses the job's lowest grade. Preserve actual grade numbers, including gaps.
-- Run after your hiring system has authorised the application.
local success, errorMessage = exports["sky_jobs_base"]:setJobMember("sunrise_cafe", playerId)
if not success then
print(("Hiring failed: %s"):format(errorMessage))
end
See Players & members for employee record fields and offline examples.
Company accounts
| Export | Arguments | Returns |
|---|---|---|
getJobMoney(jobName) | Technical job name | Current balance; 0 for an invalid job |
addJobMoney(jobName, amount) | Job and positive whole amount | Success as boolean |
removeJobMoney(jobName, amount) | Job and positive whole amount | Success as boolean |
For example, credit the company after a sale confirmed by your server script:
local credited = exports["sky_jobs_base"]:addJobMoney("sunrise_cafe", 250)
Check the result before confirming the transaction to the player. Calculate prices and rewards on the server. See Society money for details.
Billing
Use CreateInvoice(request) to issue an invoice from your own service workflow. It returns { success = true, data = invoice } or { success = false, error = code }.
The Billing reference covers the full request, player/company recipients, payment modes, employee shares and the sky_jobs_base:billing:changed server event. Successful invoice creation does not mean the invoice was paid; check its payment status.
Salary
| Export | Returns |
|---|---|
pausePlayerSalary(playerId) | boolean |
resumePlayerSalary(playerId) | boolean |
isPlayerSalaryPaused(playerId) | boolean |
getGradeSalary(jobName, grade) | Salary amount, interval in minutes |
The pause state lasts until resumed or the player disconnects. See Salary.
Business and announcements
| Export | Use |
|---|---|
GetBusinessState(jobName) | Read opening state and configured blip values; nil if unavailable |
GetBusinessContext(playerId) | Read the employee's authorised Business context |
GetBusinessHistory(playerId, request) | Read announcement history for the employee's current job |
SubmitBusinessAnnouncement(playerId, request) | Publish as an employee, with duty, permission and cooldown checks |
SetBusinessOpen(jobName, open, message?, announce?, actorId?) | Change opening state from trusted server automation; true or false, reason |
BroadcastBusinessAnnouncement(jobName, kind, message?, actorId?) | Publish from trusted server automation; true or false, reason |
For player actions use SubmitBusinessAnnouncement with the authenticated handler's player ID. actorId on the automation exports only supplies history context. See Business for request fields and error codes.
Storage
| Export | Returns |
|---|---|
GetStorageItemCount(stationId, jobName, grade, itemName) | Item count; 0 if missing |
RemoveStorageItem(stationId, jobName, grade, itemName, amount) | boolean |
AddStorageItem(stationId, jobName, grade, itemName, amount, metadata?) | success, reason? |
AddStorageItems(stationId, jobName, grade, items) | success, reason? |
Use the storage point's actual ID and authorise the supplied job/grade in your server script. These calls operate on shared station storage. See Storage for capacity, metadata and batch examples.
Vehicles and deliveries
Use registerExternalVehicle(plate, jobName, model, netId?, ownerSource?, trunkCapacity?) after your external garage spawns a job vehicle, and unregisterExternalVehicle(plate) when it is removed. See External garage integration for the complete spawn/cleanup example and accepted values.
For delivery scripts, use the Wholesale orders exports to read, accept, reject and complete orders. Completing an order and depositing stock are separate operations; persist which delivery you completed before allowing it to run again.
Permissions and events
hasJobPermission(playerId, permission, jobName?) checks a registered employee permission. Use the exact permission keys from Permissions.
React to job, duty, employee and invoice changes with Events. These notifications let your integration update when something changes, without repeatedly polling exports.