# Exports

{% tabs %}
{% tab title="Client Exports" %}
**`checkJob`** - Runs the `config/jobs.lua checkJob` function for opening the boss menu

```lua
---@param jobName string Players job to check
---@return boolean, boolean, boolean, boolean, <number or string>, table
exports['mk_bossmenu']:checkJob(jobName)

--Example to open Bossmenu
local canHire, canFire, canDeposit, canWithdraw, grade, jobGrades = exports['mk_bossmenu']:checkJob('police')
if canHire or canFire or canDeposit or canWithdraw then 
    TriggerEvent('MK_BossMenu:Client:OpenBossMenu', {
        Name = 'police',
        CanHire = canHire,
        CanFire = canFire,
        CanDeposit = canDeposit,
        CanWithdraw = canWithdraw,
        Grade = grade,
        Type = 'job',
        JobGrades = jobGrades,
    })
end
```

**`checkGang`** - Runs the `config/gangs.lua checkGang` function for opening the boss menu

```lua
---@param gangName string Players gang to check
---@return boolean, boolean, boolean, boolean, <number or string>, table
exports['mk_bossmenu']:checkGang(gangName)

--Example to open Bossmenu
local canHire, canFire, canDeposit, canWithdraw, grade, gangGrades = exports['mk_bossmenu']:checkGang('lostmc')
if canHire or canFire or canDeposit or canWithdraw then 
    TriggerEvent('MK_BossMenu:Client:OpenBossMenu', {
        Name = 'lostmc',
        CanHire = canHire,
        CanFire = canFire,
        CanDeposit = canDeposit, 
        CanWithdraw = canWithdraw,
        Grade = grade,
        Type = 'gang',
        JobGrades = gangGrades,
    })
end
```

{% endtab %}

{% tab title="Server Exports" %}
**`getSocietyBalance`** - Get current balance of a society account

```lua
---@param name string job or gang name
---@param checkType string 'job' or 'gang'
---@return false/number Returns false if society doesn't exist or society balance
exports['mk_bossmenu']:getSocietyBalance(name, checkType)

--Example
local balance = exports['mk_bossmenu']:getSocietyBalance('lostmc', 'gang')
if balance then 
    print('the lost mc society balance is', balance)
else
    print('society account not found')
end
```

**`updateSocietyBalance`** - Increase/Decrease the balance of a society account. *This does not remove player money.*

```lua
---@param deposit boolean true increases the balance by the amount given, false decreases the balance by the amount given
---@param name string job or gang name
---@param checkType string 'job' or 'gang'
---@param amount number Amount to increase or decrease the balance
---@return number or false Returns new balance if successful or false if not
exports['mk_bossmenu']:updateSocietyBalance(deposit, name, checkType, amount)

--Increase balance example
if exports['mk_bossmenu']:updateSocietyBalance(true, 'police', 'job', 5000) then 
    print('$5,000 was added to the Police society.')
else
    print('failed to add money to this society account')
end

--Decrease balance example
if exports['mk_bossmenu']:updateSocietyBalance(false, 'lostmc', 'gang', 5000) then 
    print('$5,000 was removed from the lost mc society.')
else
    print('failed to remove money from this society account')
end
```

{% endtab %}
{% endtabs %}
