# Society

When players purchase chips from the Cashier, the money spent is deposited into a shared society account. Conversely, when players trade in their chips for money, the funds are drawn from this account. This setup adds a realistic economic element to your casino.

### esx\_society, esx\_addonaccount

1. set `SocietyFramework` to `'esx_addonaccount'` in casino's config.lua
2. insert `'society_casino'` row in the MYSQL tables: `addon_account`and `addon_account_data`

```sql
INSERT INTO `addon_account` (`name`, `label`, `shared`) VALUES ('society_casino', 'society_casino', 1);
INSERT INTO `addon_account_data` (`account_name`, `money`, `owner`) VALUES ('society_casino', 0, NULL);
```

### qb-management, qb-bossmenu

1. install the "casino" job in your /shared/jobs.lua
2. set `SocietyName` to `'casino'`**,** and `SocietyFramework` to `'qb-management'` in casino's config.lua
3. insert `'casino'` row in the MYSQL table: `management_funds` (type boss)

### qb-banking 2.0 and higher

1. install the "casino" job in your /shared/jobs.lua
2. set `SocietyName` to `'casino'` and `SocietyFramework` to `'qb-banking'` in casino's config.lua
3. insert `'casino'` row in the MYSQL table: `bank_accounts` (type job)

### renewed-banking

1. set `SocietyFramework` to `Renewed-Banking` in casino's config.lua
2. insert `'society_casino'` in the MYSQL table: `bank_accounts_new`

### okokbanking

1. insert your society name in the MYSQL table: `okokbanking_societies` if not using addonaccount.
2. insert your society name in Config.Societies list in okokbanking's config file

### 710-management

1. create your society in 710-management menu, and make sure it's installed in the MYSQL table: `management_accounts`
2. set `SocietyFramework` to `710-Management` in casino's config.lua

### custom society resource

If you're using a custom framework/resource, you can manage the casino funds with your own society resource. Modify these three functions in **/server/main/society.lua**:

#### 1. To deduct money from the society fund:

```lua
function RemoveMoneyFromSociety(money)
    -- Add your own method to manage society money here
end
```

#### 2. To add money to the society fund:

```lua
function GiveMoneyToSociety(money)
    -- Add your own method to manage society money here
end
```

#### 3. To retrieve money from the society fund:

```lua
function GetMoneyFromSociety()
    -- Add your own method to manage society money here
    return 10000
end
```

To edit the society settings, look into file **config.lua**

### **Enabling Society Account**

```
EnableSociety = true
```

Whether you want to use a society account for all Casino payouts/deposits. When disabled, all payouts are directly sent to players without affecting any bank/society accounts.

### Limiting Payouts (Empty Society Account)

```
SocietyEmptyWithdrawPercentage = 35
```

When your society account is empty, you can reduce players payouts. Example code above is a percentage, how much money players get from their chips-to-money transaction.

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-eb40f4b310423548a5c6fac99c06f559518567c3%2FScreenshot_13.png?alt=media\&token=04034a6e-9968-436f-94f5-05c4195c53f4)

### Disabling Payouts (Empty Society Account)

```
SocietyEmptyWithdrawPercentage = 0
```

To halt all Casino payouts (Trade In Chips at the Cashier) when your society account is empty , use the example setting above.

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-4b5f053801f36ca3115fbc2639ad444a79c82934%2FScreenshot_15.png?alt=media\&token=d9623206-3db5-4c14-9961-e938146c7247)
