HEX
HexscriptsJobscreatorExportsServer Exports

Society Money

Server exports to read, add and remove money on a job's society account.

The account argument

account is optional on all three exports: 'legal' (default) or 'illegal' ('black' is also accepted).

getSocietyMoney

Needs a thread see Calling from a thread.

The current balance of a society account.

local balance = exports['hex_jobscreator']:getSocietyMoney('police')
local dirty = exports['hex_jobscreator']:getSocietyMoney('ballas', 'illegal')

Prop

Type

Returns

ValueMeaning
numbercurrent balance
nil, reasonsee the reasons below

Reasons

CodeMeaning
invalid_jobjob name must be a non-empty string
unknown_jobno job with that name
invalid_accountaccount must be legal or illegal
no_banking_bridgesociety banking is set to none

addSocietyMoney

Needs a thread see Calling from a thread.

Adds money to a society account.

local ok, err = exports['hex_jobscreator']:addSocietyMoney('police', 5000)

Prop

Type

Returns

ValueMeaning
truemoney added
false, reasonevery reason getSocietyMoney can return, plus those below

Extra reasons

CodeMeaning
invalid_amountamount must be a positive whole number
account_unavailablethe society bank account could not be reached

removeSocietyMoney

Needs a thread see Calling from a thread.

Removes money from a society account. Checks the balance first and refuses to overdraw.

local ok, err = exports['hex_jobscreator']:removeSocietyMoney('police', 5000)

Prop

Type

Returns

ValueMeaning
truemoney removed
false, reasonevery reason getSocietyMoney can return, plus those below

Extra reasons

CodeMeaning
invalid_amountamount must be a positive whole number
insufficient_fundsthe society account does not hold that much
account_unavailablethe society bank account could not be reached