# Server/Framework support

## SERVER SIDE:

```lua
-- The reason of these functions is to elliminate Framework dependency
-- and allow for adaptability on any kind of accounts/society/inventory scripts
-- for the script to work , you would have to fill the functions here !
ESX = nil
QBCore = nil
QBX = nil
function AddLaunderedMoney(playerId,whiteEconomy,amount)
    exports.ox_inventory:AddItem(playerId,whiteEconomy,amount)
end

function AddJobMoney(job,amount)
    -- You can add your own logic on how the job will recive the money , 
    -- the amount on top has alredy beed divided by the rate you set in the config
    -- an example with our unreleased society script
    -- !!! THIS EXAMPLE WILL NOT WORK ON YOUR SERVER !!!

    -- local _, func = exports.ip_society:GetSocietyAccount(job)
    -- func.add(amount)
end

function LogLaunder(data)
    -- You can add your logs here, this is called whenever somebody starts laundering
    --DATA:
    --source
    --name
    --message
    --amount
    --location (jobName)
    --amount_to_job
end

function LogFinishLaunder(data)
    -- You can add your logs here, this is called whenever somebody recives money from laundering
    -- DATA:
    -- source
    -- message
    -- amount
end

function SearchPlayerMoney(playerId)
--this must return an amount i.e 50000
-- an example using ox_inventory
    return exports.ox_inventory:Search(playerId, 'count', Config.blackEconomy)
end

function RemovePlayerMoney(playerId, amount)
    --example using ox_inventory
    exports.ox_inventory:RemoveItem(playerId, Config.blackEconomy, amount)
end

function RemovePlayerItem(playerId, item, amount)
    --example using ox_inventory
    exports.ox_inventory:RemoveItem(playerId, item, amount)
end
```

## CLIENT SIDE:

```lua
function HasItem(item)
    return exports.ox_inventory:Search("count", item)
end
```


---

# 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.infinitypulse.dev/fivem/money-laundering/server-framework-support.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.
