# DXS Inventory Logs

<figure><img src="/files/CXF92qskN4HDqaFvNy4y" alt=""><figcaption></figcaption></figure>

### Installation

1. Place the resource in your server resources folder with the folder name:
   * `resources/[dxs]/dxs_inventorylogs`
2. Ensure that `ox_inventory` and `ox_lib` are installed and started correctly.
3. Add this line to your `server.cfg` after the dependencies:
   * `ensure dxs_inventorylogs`
4. Restart the server.

### Configuration

All basic settings can be found in the [config.lua](file:///d:/Testing%20FiveM%20Server/server/resources/%5Bdxs%5D/dxs_inventorylogs/config.lua) file.

* `Config.Debug`
  * Set to `true` to see extra debug messages in the console.
* `Config.Framework`
  * `'ESX'`, `'QBCore'`, or `'auto'`
  * In `'auto'` mode, the script automatically detects the `es_extended` / `qb-core` resource.
* `Config.Webhooks`
  * You can set different webhook URLs for different actions:
    * `default` (fallback)
    * `itemAdded`, `itemRemoved`
    * `give`, `drop`, `pickup`
    * `shop`
    * `stash`, `glovebox`, `trade`
  * Any empty category will use the `default` webhook.
  * **Important:** Paste your own Discord webhook URLs here. Never keep real webhooks in a public repo.
* `Config.Colors`
  * Discord embed color codes (in decimal):
    * `add` (green)
    * `remove` (red)
    * `move` (blue)
    * `warning` (yellow)
* `Config.BotName` and `Config.BotAvatar`
  * The bot name and avatar URL displayed in the Discord embed.

### Events Covered (ox\_inventory hooks)

The script uses `ox_inventory:registerHook` to listen for these events:

* `swapItems`
  * Player to player give
  * Player to drop / stash / trunk / glovebox
  * Drop / stash / trunk / glovebox to player
  * Generic item move in/out
* `buyItem`
  * Shop item purchases (with price, currency, shopId)
* `createItem`
  * Item added to inventory via Admin / script
* `removeItem`
  * Admin / script remove or item usage

By default, each embed includes this info:

* Player character name + server ID
* Item label + quantity
* Context-specific fields:
  * Drop coords
  * Vehicle plate (trunk / glovebox)
  * Stash name / ID
  * Shop ID

### Usage Tips

* If you only want basic logging, setting the `default` webhook is sufficient.
* If you want detailed channels (e.g., separate channels for drops, shops, trades), use different webhooks for each category.
* Keep debug mode `true` only during testing; keep it `false` in production.

### Credits

* Script: DXS (see `author` in fxmanifest)
* Dependencies: `ox_inventory`, `ox_lib`


---

# 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://dxs-scripts.gitbook.io/home/documentation/fivem/dxs-inventory-logs.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.
