PoisonCode Docs
TebexDiscordYoutube
  • SCRIPTS
    • 💡pc_collections
      • ✨Features
      • 🖥️Installation & dependencies
      • 🛠️Exports & events
      • ⚙️Open files preview
      • 🔧Tutorials
      • 📥Updates
        • 🤔How to update
        • 🔌Version compatibility
    • 💎pc_organizations
      • ✨Features
      • 🖥️Installation & dependencies
      • 🛠️Exports & events
      • ⚙️Open files preview
      • 🔧Tutorials
      • 📥Updates
        • 🤔How to update
        • 🔌Version compatibility
    • 💡pc_skills
      • ✨Features
      • 🖥️Installation & dependencies
      • 🛠️Exports & events
      • ⚙️Open files preview
      • 🔧Tutorials
      • 📥Updates
        • 🤔How to update
    • 📦pc_airdrop
      • ✨Features
      • 🖥️Installation & dependencies
      • ⚙️Open files preview
      • 🔧Tutorials
      • 📥Updates
        • 🤔How to update
    • 💬pc_notifications
      • ✨Features
      • 🖥️Installation & dependencies
      • 🕹️Usage
Powered by GitBook
On this page
  • config/config.lua
  • config/translations.lua
  • client/utils.lua
  • server/utils.lua

Was this helpful?

  1. SCRIPTS
  2. pc_collections

Open files preview

Config files preview, these files are ignored by the escrow system and can be modified.

This script is customizable, there is a total of 2 files accessible for you.

config/config.lua

Click here to see a preview config.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,
    },
}

config/translations.lua

Click here to see a preview translations.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",
}

client/utils.lua

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

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

server/utils.lua

Click here to see a preview utils.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

If you encounter any problems during configuration, you can create a support ticket on our discord.

PreviousExports & eventsNextTutorials

Last updated 4 months ago

Was this helpful?

💡
⚙️