> For the complete documentation index, see [llms.txt](https://docs.sonoransoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonoransoftware.com/store/evidence-camera/advanced-docs.md).

# Advanced Documentation

## Custom Inventory Integration

If you wish to use a custom inventory please first ensure that `use_custom_inventory` is set to `true` in your `config.lua`

For all the handling of photo items please see the `/server/inventory.lua` file. In this file it is recommended that do the following:

#### Define your framework. Ex. Below

```lua
local QBCore = nil
if config.frameworks.use_qbcore then
    QBCore = exports["qb-core"]:GetCoreObject()
end
```

#### Begin your handling (All examples will be shown using QBCore)

First we will register our item with the framework. Ex. Below

```lua
        exports["qb-core"]:AddItem("sonoran_evidence_photo", {
            name = "sonoran_evidence_photo",
            label = "Photo",
            weight = 0,
            type = "item",
            image = "evidence.png",
            unique = true,
            useable = true,
            shouldClose = false,
            combinable = nil,
            description = "A sweet polaroid photo"
        })
        QBCore.Functions.CreateUseableItem("sonoran_evidence_photo", function(source, item)
            TriggerClientEvent("sonoran:lookphoto:qbcore", source, item)
        end)
```

Next we will make the item usable. Example below:

```lua
        QBCore.Functions.CreateUseableItem("sonoran_evidence_photo", function(source, item)
            TriggerClientEvent("sonoran:lookphoto:qbcore", source, item)
        end)
```

Now that our item is registered and usable we will begin the handling. The following event will be triggered when the photo is first put away. You will want to use this to cache the images link. `Sononran:PutAway:Custom:First`. The example handling will be used in the form of QBCore. See below for example.

```lua
    RegisterNetEvent("Sononran:PutAway:Custom:First", function(image)
        local Player = QBCore.Functions.GetPlayer(source)
        if not Player then
            return
        end
        local info = {}
        info.image_link = image
        Player.Functions.AddItem("sonoran_evidence_photo", 1, nil, info)
    end)
```

### Passed Parameters To `Sononran:PutAway:Custom:First`

| Parameter Name | Parameter Description |
| -------------- | --------------------- |
| `image`        | The direct image link |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sonoransoftware.com/store/evidence-camera/advanced-docs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
