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
| Value | Meaning |
|---|---|
| number | current balance |
nil, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_job | job name must be a non-empty string |
unknown_job | no job with that name |
invalid_account | account must be legal or illegal |
no_banking_bridge | society 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
| Value | Meaning |
|---|---|
true | money added |
false, reason | every reason getSocietyMoney can return, plus those below |
Extra reasons
| Code | Meaning |
|---|---|
invalid_amount | amount must be a positive whole number |
account_unavailable | the 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
| Value | Meaning |
|---|---|
true | money removed |
false, reason | every reason getSocietyMoney can return, plus those below |
Extra reasons
| Code | Meaning |
|---|---|
invalid_amount | amount must be a positive whole number |
insufficient_funds | the society account does not hold that much |
account_unavailable | the society bank account could not be reached |