# Open files preview

{% hint style="success" %}
This script is customizable, there is a total of 2 files accessible for you.
{% endhint %}

## config/config.lua

<details>

<summary>Click here to see a preview config.lua</summary>

```lua
Config = {}
-- _____                          _____          _      
-- |  __ \    (_)                / ____|        | |     
-- | |__) |__  _ ___  ___  _ __ | |     ___   __| | ___ 
-- |  ___/ _ \| / __|/ _ \| '_ \| |    / _ \ / _` |/ _ \
-- | |  | (_) | \__ \ (_) | | | | |___| (_) | (_| |  __/
-- |_|   \___/|_|___/\___/|_| |_|\_____\___/ \__,_|\___|
-- © PoisonCode 
-- Discord: https://discord.gg/rNJ8cHXCsN
-- Tebex: https://tebex.poisoncode.com

Config.Debug = false -- Enable debug messages
Config.Framework = "ESX" -- Available options: "ESX", "QBCore", "QBox", "ox_core"

Config.UseOxInventory = GetResourceState('ox_inventory') == 'started' or false
Config.UsePcNotifications = GetResourceState('pc_notifications') == 'started' or false

Config.pc_skills =  {
    enabled = false, -- Set to true if you want to use pc_skills integration. pc_skills resource is required https://tebex.poisoncode.com/product/6598558
    skill = "skill1", -- Skill name from pc_skills
}

Config.ShowClaimLimits = true -- Show claim limits in the UI

Config.Collections = {
    ["collection1"] = { -- Collection name
        order = 1, -- Order in the list
        label = "Food collection", -- Collection name
        limit = false, -- Limit how many times player can complete this collection, set to false for unlimited
        items = { -- Items required to complete this collection
            {name = "burger", label = "Burger", count = 2},
            {name = "hotdog", label = "Hotdog", count = 3},
            {name = "coffe", label = "Coffe", count = 1},
        },
        reward = { -- Items rewarded for completing this collection
            {name = "money", label = "Cash", count = 500},
            {name = "water", label = "Water Bottles", count = 3},
        },

        -- pc_skills integration
        lvl = 1, -- Level required to unlock this collection, only works if Config.pc_skills.enabled is set to true
        rewardXP = 200, -- Experience points rewarded for completing this collection, only works if Config.pc_skills.enabled is set to true
    },
    ["collection2"] = {
        order = 2,
        label = "Drugs collection",
        limit = 1,
        items = {
            {name = "weed", label = "Weed", count = 1},
            {name = "meth_60", label = "Meth 60%", count = 1},
            {name = "coke_bag30", label = "Coke 30%", count = 1},
        },
        reward = {
            {name = "parts_premium", label = "Premium Parts", count = 1},
            {name = "weapon_pistol", label = "pistol", count = 1}
        },

        -- pc_skills integration
        lvl = 1,
        rewardXP = 10,
    },
    ["collection3"] = {
        order = 3,
        label = "Advanced collection",
        limit = 1,
        items = {
            {name = "phone", label = "Phone", count = 1},
            {name = "lowbulletproofvest", label = "Bulletproof vest", count = 1},
            {name = "mask", label = "Mask", count = 1},
        },
        reward = {
            {name = "rare_parts_premium", label = "Rare Premium Parts", count = 2},
            {name = "gold_bar", label = "Gold Bars", count = 3}
        },

        -- pc_skills integration
        lvl = 10,
        rewardXP = 20,
    },
}
```

</details>

## config/translations.lua

<details>

<summary>Click here to see a preview translations.lua</summary>

```lua
-- _____                          _____          _      
-- |  __ \    (_)                / ____|        | |     
-- | |__) |__  _ ___  ___  _ __ | |     ___   __| | ___ 
-- |  ___/ _ \| / __|/ _ \| '_ \| |    / _ \ / _` |/ _ \
-- | |  | (_) | \__ \ (_) | | | | |___| (_) | (_| |  __/
-- |_|   \___/|_|___/\___/|_| |_|\_____\___/ \__,_|\___|
-- © PoisonCode 
-- Discord: https://discord.gg/rNJ8cHXCsN
-- Tebex: https://tebex.poisoncode.com

Translations = {
    collections = "Collections",
    rewards = "Rewards",
    claim = "Claim",
    limitReached = "Limit reached",
    claimLimit = "Claim Limit",
    unlimitedClaims = "Unlimited Claims",
    exchange_successful = "Exchange successful",
    exchange_successful_desc = "You have successfully exchanged your items",
    limit = "Limit",
    unlimited = "Unlimited",
}
```

</details>

## client/utils.lua

<details>

<summary>Click here to see a preview utils.lua</summary>

```lua
-- _____                          _____          _      
-- |  __ \    (_)                / ____|        | |     
-- | |__) |__  _ ___  ___  _ __ | |     ___   __| | ___ 
-- |  ___/ _ \| / __|/ _ \| '_ \| |    / _ \ / _` |/ _ \
-- | |  | (_) | \__ \ (_) | | | | |___| (_) | (_| |  __/
-- |_|   \___/|_|___/\___/|_| |_|\_____\___/ \__,_|\___|
-- © PoisonCode 
-- Discord: https://discord.gg/rNJ8cHXCsN
-- Tebex: https://tebex.poisoncode.com

RegisterCommand("collections", function(source, args)
    showUI(not isUiDisplayed)
end)
```

</details>

## server/utils.lua

<details>

<summary>Click here to see a preview utils.lua</summary>

```lua
-- _____                          _____          _      
-- |  __ \    (_)                / ____|        | |     
-- | |__) |__  _ ___  ___  _ __ | |     ___   __| | ___ 
-- |  ___/ _ \| / __|/ _ \| '_ \| |    / _ \ / _` |/ _ \
-- | |  | (_) | \__ \ (_) | | | | |___| (_) | (_| |  __/
-- |_|   \___/|_|___/\___/|_| |_|\_____\___/ \__,_|\___|
-- © PoisonCode 
-- Discord: https://discord.gg/rNJ8cHXCsN
-- Tebex: https://tebex.poisoncode.com

function sendClientNotification(source, title, text, time, type)
    if Config.UsePcNotifications then
        TriggerClientEvent('pc_notifications:Notify', source, type, title, text, time, true) 
    else

    end
end
```

</details>

{% hint style="info" %}
If you encounter any problems during configuration, you can create a support ticket on our discord.
{% endhint %}


---

# 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.poisoncode.com/scripts/pc_collections/open-files-preview.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.
