# Exports

There are two available server side exports for usage:

```lua
exports['bk_politicalsystem']:AddMoneyIncome(target, account, money)
```

which gives player money and deducts a part based on Income Tax Rate and

```lua
exports['bk_politicalsystem']:RemoveMoneyVAT(target, account, money)
```

which removes player money and deducts money based on VAT Tax Rate

## Arguments

There are 3 arguments

* target - player server ID
* account - account to remove money ('bank', 'money', 'cash', etc.)
* money - amount of money to process

## Example

Example on a shop script:

Before:

{% tabs %}
{% tab title="ESX" %}

```lua
local xPlayer = ESX.GetPlayerFromId(source)
local bread_price = 10

xPlayer.removeAccountMoney('money', bread_price)
xPlayer.addInventoryItem('bread', 1)
```

{% endtab %}

{% tab title="QB/Qbox" %}

```lua
local Player = QBCore.Functions.GetPlayer(source)
local bread_price = 10

Player.Functions.RemoveMoney('cash', bread_price)
exports['qb-inventory']:AddItem(source, 'bread', 1)
```

{% endtab %}
{% endtabs %}

After installation:

{% tabs %}
{% tab title="ESX" %}

```lua
local xPlayer = ESX.GetPlayerFromId(source)
local bread_price = 10

exports['bk_politicalsystem']:RemoveMoneyVAT(source, 'money', bread_price)
xPlayer.addInventoryItem('bread', 1)
```

{% endtab %}

{% tab title="QB/Qbox" %}

```lua
local bread_price = 10

exports['bk_politicalsystem']:RemoveMoneyVAT(source, 'cash', bread_price)
exports['qb-inventory']:AddItem(source, 'bread', 1)
```

{% endtab %}
{% endtabs %}

## Adding income tax into paycheck system

{% tabs %}
{% tab title="ESX" %}

1. Go to es\_extended/server/paycheck.lua
2. Find 1 of this:

{% code fullWidth="true" %}

```lua
xPlayer.addAccountMoney("bank", salary, "Welfare Check")
```

{% endcode %}

and 3 of these

```lua
xPlayer.addAccountMoney("bank", salary, "Paycheck")
```

3. Replace those with

```lua
exports['bk_politicalsystem']:AddMoneyIncome(xPlayer.source, 'bank', salary)
```

4. Ready for usage !
   {% endtab %}

{% tab title="QB/Qbox" %}

1. Go to qb-core/server/functions.lua
2. Go to function on line 398
3. Find 3 of these in that function

```lua
Player.Functions.AddMoney('bank', payment, 'paycheck')
```

4. Replace them with these:

```lua
exports['bk_politicalsystem']:AddMoneyIncome(Player.PlayerData.source, 'bank', payment)
```

5. Ready for usage !
   {% endtab %}
   {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bkscripts.com/scripts/bk_politicalsystem/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
