Exports

Server-Side Exports

updateStats

What it does Increments a particular stat (e.g. arrests, ticketsIssued) for a player’s job, and optionally logs the event.

Parameters

  1. src (number) — the player’s server source ID

  2. jobName (string) — key of the job to update (e.g. "police")

  3. statName (string) — which stat to bump ("arrests", "ticketsIssued", etc.)

  4. amount (number) — how much to add

  5. doLog (boolean) — if true, the update will be logged (if logging is enabled)

Example

-- From server-side code, give player 10 more arrests in “police”
local src = 42
exports['sd-multijob']:updateStats(src, "police", "arrests", 10, true)

addSocietyDeposit

What it does Deposits funds into the specified job’s society account.

Parameters

  1. source (number) — the boss’s server source ID

  2. jobName (string) — the society job key (e.g. "mechanic")

  3. amount (number) — how much to deposit (must be > 0)

  4. moneyType (string)"cash" or "bank"

Returns

  • (number) new society balance on success

  • false on error (e.g. insufficient funds, invalid job)

Example

withdrawSocietyFunds

What it does Removes money from the shared society account and gives it to the boss’s cash or bank.

Parameters

  1. source (number) — the boss’s server source ID

  2. jobName (string) — the society job key (e.g. "ambulance")

  3. amount (number) — how much to withdraw (must be > 0)

  4. moneyType (string)"cash" or "bank"

Returns

  • (number) new society balance on success

  • false on error (e.g. not a boss, insufficient society funds)

Example

getSocietyBalance

What it does Returns the current balance of the boss’s society account, and (if applicable) the full transaction history.

Parameters

  1. source (number) — any player source; must be a boss of at least one job

Returns

  • (number) current society balance

  • (table | nil) array of transaction records, each { date, who, name, action, amount }, or nil if using external banking

Example

addJob

What it does Adds or updates a job entry for the given player’s identifier, setting their grade and marking if they’re a boss (based on configured boss grades). Logs the event if job‐selection logging is enabled.

Parameters

  • src (number) — the player’s server source ID

  • jobName (string) — key of the job to add or update (e.g. "police")

  • grade (number) — the grade level to assign

Example

removeJob

What it does Removes the specified job from the given player’s saved jobs table (so they no longer have access to it). Does not automatically change their current active in-game job state; for that, use the corresponding player-focused callback or helper. Logs the event if job-removal logging is enabled.

Parameters

  • src (number) — the player’s server source ID

  • jobName (string) — key of the job to remove (e.g. "ambulance")

Example

logTransaction

What it does Appends an entry to the society transaction log for the specified job, recording date/time, the player’s identifier and name, the action type, and the amount moved.

Parameters

  • src (number) — the player’s server source ID

  • action (string) — type of transaction ("deposit", "withdrawal", "bonus", etc.)

  • amount (number) — amount of money moved

  • jobName (string) — key of the job whose society log to record (e.g. "police")

Example

getSavedJobs

What it does Returns a Lua table mapping every saved job name to its grade for a given player.

Parameters

  • srcOrIdent (number | string) — either the player’s server source ID or their identifier string.

Returns

  • (table) — a map where keys are job names and values are grade numbers. Returns an empty table if the identifier is invalid or has no saved jobs.

Example

Last updated