> For the complete documentation index, see [llms.txt](https://nayzeee-dev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nayzeee-dev.gitbook.io/docs/nayzeee-scripts/nayzeee-inventory-manager/installation.md).

# Installation

## Installation

1. **Ensure all dependencies are installed**\
   \&#xNAN;*Be sure all required dependencies are installed, running, and utilizing the latest versions available.*
2. **Drag script into resources directory**\
   \&#xNAN;*Place the `nayzeee-inventorylogs` folder into your server's resources directory.*
3. **Configure Script**\
   \&#xNAN;*Configure the script to your liking inside `configs/config.lua`.* Example configuration:

```lua
Config.Framework = 'auto'
Config.AdminGroups = { 'admin', 'superadmin', 'god', 'owner' }
Config.Command = 'inventorymanager'
Config.LogRetentionDays = 30
Config.AllowRemoteOpen = true
```

4. **Add Discord Webhooks** *(Optional)*\
   \&#xNAN;*Add your Discord webhook URLs to `Config.Webhooks` for any log types you want sent to Discord. Leave empty `''` to disable.*

```lua
Config.Webhooks = {
    ['drop']         = 'https://discord.com/api/webhooks/...',
    ['pickup']       = '',  -- disabled
    ['trunk_put']    = 'https://discord.com/api/webhooks/...',
}
```

5. **Add to server.cfg**\
   \&#xNAN;*Ensure the resource in your `server.cfg` after all dependencies.*

```cfg
ensure ox_lib
ensure oxmysql
ensure ox_inventory
ensure nayzeee-inventorylogs
```

6. **Restart/Start Server**\
   \&#xNAN;*Restart your server or start the resource. The database table creates itself automatically on first start.*

***

**Troubleshooting**

| Issue                       | Solution                                                           |
| --------------------------- | ------------------------------------------------------------------ |
| `Config.EnabledLogs is nil` | Make sure `Config` is spelled correctly (capital C, not `CConfig`) |
| Panel doesn't open          | Verify your admin group matches one in `Config.AdminGroups`        |
| Webhooks not sending        | Ensure webhook URLs are valid and not empty                        |
| Backpacks log as stash      | Ensure wasabi\_backpack is installed and running                   |
| Database table not created  | Ensure oxmysql starts before this resource                         |
| Framework not detected      | Set `Config.Framework` manually to `'qbcore'` or `'esx'`           |
| Remove button fails         | Ensure `Config.AllowRemoteOpen = true`                             |
| `/openinv` fails            | Target player must be online. Check admin permissions.             |
