> For the complete documentation index, see [llms.txt](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duddzy-scripts.gitbook.io/duddzy-scripts-docs/scripts/duddzy-jail-3/configuration-overview/society-and-job-config.md).

# Society & Job Config

DZ Customs includes optional society account payments and job-based pricing.

These features are useful for mechanic shops, job-restricted locations, staff garages, or roleplay businesses.

***

## Society Payments

Society payments allow configured jobs to pay for customisations using a shared society account.

***

### Enable Society Payments

In `shared/config.lua`:

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = true
}

Config.SocietyPayment = {
    enabled = true,

    accountPrefix = 'society_',

    allowedJobs = {
        mechanic = true
    },

    requireBoss = false
}
```

***

### Requirements

Society payments require a compatible ESX society/account system, such as:

```
esx_society
esx_addonaccount
```

Your server must have the society account created.

Example account:

```
society_mechanic
```

***

### Account Name Format

DZ Customs builds the society account name using:

```lua
accountPrefix .. jobName
```

Example:

```lua
accountPrefix = 'society_'
jobName = 'mechanic'
```

Result:

```
society_mechanic
```

***

### Allowed Jobs

Only jobs listed in `allowedJobs` can use society payment.

```lua
allowedJobs = {
    mechanic = true,
    police = true
}
```

If a player’s job is not listed, society payment will be rejected.

***

### Boss-Only Society Payment

To allow only boss grade players to use society funds:

```lua
requireBoss = true
```

To allow any allowed job member:

```lua
requireBoss = false
```

***

### Disable Society Payments

If your server does not use society accounts, use:

```lua
Config.PaymentMethods = {
    cash = true,
    bank = true,
    society = false
}

Config.SocietyPayment = {
    enabled = false,
    accountPrefix = 'society_',
    allowedJobs = {
        mechanic = true
    },
    requireBoss = false
}
```

This is the recommended default for servers without `esx_society`.

***

### Common Society Errors

#### Society payment is disabled

Check:

```lua
Config.PaymentMethods.society = true
Config.SocietyPayment.enabled = true
```

***

#### Your job cannot use society payment

Add the job to:

```lua
Config.SocietyPayment.allowedJobs
```

Example:

```lua
allowedJobs = {
    mechanic = true
}
```

***

#### Society account could not be found

Make sure the shared account exists.

Example:

```
society_mechanic
```

Also confirm your society resource is started before DZ Customs.

***

#### Society account does not have enough money

Deposit funds into the society account using your society/boss menu system.

***

## Job Pricing

Job pricing allows configured jobs to receive discounts or free customisations.

***

### Job Pricing Config

```lua
Config.JobPricing = {
    enabled = true,

    discounts = {
        mechanic = 0.25
    },

    freeJobs = {
        -- police = true,
        -- mechanic = true
    }
}
```

***

### Job Discounts

Discount values are decimal percentages.

Examples:

```lua
discounts = {
    mechanic = 0.25, -- 25% off
    police = 0.50   -- 50% off
}
```

A basket costing `10000` with a `0.25` discount becomes:

```
Original total: 10000
Discount: 2500
Final total: 7500
```

***

### Free Jobs

Jobs listed in `freeJobs` pay nothing.

```lua
freeJobs = {
    mechanic = true
}
```

If a mechanic checks out, the final total becomes `0`.

***

### Disable Job Pricing

```lua
Config.JobPricing = {
    enabled = false,

    discounts = {},
    freeJobs = {}
}
```

***

### Job Pricing Order

DZ Customs calculates pricing in this order:

```
Trusted basket total
→ Job discount/free job calculation
→ Final amount
→ Payment processing
```

This means discounts are applied before cash, bank, or society balance checks.

***

### Job Pricing and Society Payments

Job pricing also applies to society payments.

Example:

```
Basket total: 10000
Mechanic discount: 25%
Society payment final charge: 7500
```

If the job is configured as free, the society account is not charged.
