# Adaptations

### Stash Adaptation

For inventory adaptation, you need to find the document of the inventory you are using and adapt it to this section.

```lua
Template.OpenStash = function(id, haveBigStash)
    local weight = haveBigStash and Config.LargeStashSize or Config.StandardStashSize
    local slots = haveBigStash and Config.largeStashSlots or Config.stashSlots

    if GetResourceMetadata("qb-inventory", "version", 0) ~= "2.0.0" then
        TriggerEvent("qb-inventory:client:openInventory", id, {
            maxweight = weight,
            slots = slots,
        })
        TriggerEvent("qb-inventory:client:setCurrentStash", id)
    else
        TriggerServerEvent("s4-illegalcaravan:qbStash", id, weight, slots)
    end
end
```

Sample adaptation for qs-inventory

```lua
Template.OpenStash = function(id, haveBigStash)
    local weight = haveBigStash and Config.LargeStashSize or Config.StandardStashSize
    local slots = haveBigStash and Config.largeStashSlots or Config.stashSlots

    local other = {}
    other.maxweight = weight -- Custom weight statsh
    other.slots = slots -- Custom slots spaces
    TriggerServerEvent("inventory:server:OpenInventory", "stash", "Stash_"..id, other)
    TriggerEvent("inventory:client:SetCurrentStash", "Stash_"..id)
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.0resmon.org/0resmon/s4-resources/illegal-caravan/adaptations.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.
