Skip to content
ESX Addons
Society

esx_society

Society management for ESX. Adds employee management (hire, fire, promote / demote, change salary), society bank accounts and money washing. It’s crucial that this script gets started before all resources that utilize societies do, or else many things will go wrong. https://github.com/esx-framework/esx_society

Requirements

  • es_extended
  • cron
  • esx_addonaccount

Configuration

  • Config.EnableESXIdentity
    • type: boolean
    • default: true
    • description: enable if using ESX Identity.
  • Config.MaxSalary
    • type: integer
    • default: 3500
    • description: the maximum salary that can be set.
  • Config.BossGrades
    • type: table
    • default: { ['boss'] = true }
    • description: grade names that are considered “bosses”.

Usage

Registering a society

Parameters:

  • name (string): the name of the society.
  • label (string): the label of the society.
  • account (string): the name of the society’s account (for esx_addonaccount).
  • datastore (string): the name of the society’s datastore (for esx_datastore).
  • inventory (string): the name of the society’s inventory (for esx_addoninventory).
  • data (table): the options for the society.
    • type (string): the type of society. Can be public or private.

Event

TriggerEvent('esx_society:registerSociety', 'mechanic', 'mechanic', 'society_mechanic', 'society_mechanic', 'society_mechanic', {type = 'private'})

Export

exports["esx_society"]:registerSociety('mechanic', 'Mechanic', 'society_mechanic', 'society_mechanic', 'society_mechanic', {type = 'private'})

Opening boss menu

Parameters:

  • society (string): the name of the society.
  • cb (function): the callback function.
  • options (table): the options for the boss menu. (all options are true by default)
    • wash (boolean): enable money washing.
    • checkBal (boolean): check the society’s balance.
    • withdraw (boolean): enable withdrawing money from the society.
    • deposit (boolean): enable depositing money to the society.
    • employees (boolean): enable employee management.
    • grades (boolean): enable job grade editing.
    • salary (boolean): enable salary editing.
local society = 'taxi'
TriggerEvent('esx_society:openBossMenu', society, function (menu)
	ESX.CloseContext()
end, {wash = false}) -- set custom options, e.g disable washing

Society Actions

Deposit money

Parameters:

  • society (string): the name of the society.
  • amount (integer): the amount to deposit.
local society = 'taxi'
local amount  = 100
 
TriggerServerEvent('esx_society:depositMoney', society, amount)

Withdraw money

Parameters:

  • society (string): the name of the society.
  • amount (integer): the amount to withdraw.
local society = 'taxi'
local amount  = 100
 
TriggerServerEvent('esx_society:withdrawMoney', society, amount)

Wash money

Parameters:

  • society (string): the name of the society.
  • amount (integer): the amount to wash.
local society = 'taxi'
local amount  = 100
 
TriggerServerEvent('esx_society:washMoney', society, amount)