Samuel's Development, Official Documentation
  • 🎉Welcome
  • đź“‘Overview
    • Resources
      • Bobcat Weapon Heist
        • Installation Guide
        • Configuration
      • Traphouse Robbery
        • Installation Guide
        • Configuration
      • Pacific Bank Heist
        • Installation Guide
        • Configuration
      • Oxy Run
        • Installation Guide
        • Configuration
      • Dumpster Diving
        • Installation Guide
        • Configuration
        • Log Configuration
      • Warehouse Heist
        • Installation Guide
        • Configuration
      • Oil Rig
        • Installation Guide
        • Configuration
      • Beekeeping
        • Installation Guide
        • Configuration
        • Log Configuration
      • Multijob & Boss Menu
        • Installation Guide
        • Exports
        • Configuration
        • Log Configuration
      • Yacht Robbery
        • Installation Guide
        • Configuration
      • Notify
        • Installation
        • Configuration
      • Cocaine Mission
        • Installation Guide
        • Configuration
      • Advanced Drug Sales
        • Installation Guide
        • Configuration
    • Library
      • Installation & Integration
      • Modules
        • Client
          • Callback
          • StartProgress
          • LoadAnim
          • LoadModel
          • LoadPtfxAsset
          • ShowNotification
          • SendEmail
          • PoliceDispatch
          • StartHack
        • Server
          • Callback
          • Name
          • Money
          • Logger
          • Inventory
          • HasGroup
          • GetPlayer
          • GetPlayers
          • GetPlayerByIdentifier
          • GetIdentifier
          • GetPlayerGender
          • CheckVersion
        • Shared
          • Array
          • Table
          • String
          • Math
          • Locale
            • JSON Example
          • AwaitLoad
          • Framework
  • 📚F.A.Q
    • How do I change Locales?!
    • How to add Police Alerts?!
    • What types of dirty money are supported?
Powered by GitBook
On this page
  • Server-Side Exports
  • updateStats
  • addSocietyDeposit
  • withdrawSocietyFunds
  • getSocietyBalance
  1. Overview
  2. Resources
  3. Multijob & Boss Menu

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 Moves money from a boss’s personal cash or bank into the shared society account for that job.

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

-- Boss deposits $500 from their bank into the police society
local src = 7
local newBalance = exports['sd-multijob']:addSocietyDeposit(src, "police", 500, "bank")
if newBalance then
    print(("Police society balance is now $%d"):format(newBalance))
else
    print("Deposit failed.")
end

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

-- Boss withdraws $200 cash from the ambulance society
local src = 13
local newBalance = exports['sd-multijob']:withdrawSocietyFunds(src, "ambulance", 200, "cash")
if newBalance then
    print(("Ambulance society balance is now $%d"):format(newBalance))
else
    print("Withdrawal failed.")
end

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

-- Fetch police society balance and history
local src = 5
local balance, history = exports['sd-multijob']:getSocietyBalance(src)
if balance then
    print(("Police society has $%d"):format(balance))
    if history then
        for _, tx in ipairs(history) do
            print(("%s — %s %s $%d"):format(tx.date, tx.name, tx.action, tx.amount))
        end
    end
else
    print("You’re not a boss or could not fetch balance.")
end
PreviousInstallation GuideNextConfiguration

Last updated 6 days ago

đź“‘