Config File

This section covers the config file of the Drug System 2.0.

Config

drugs_config.lua
wx = {}


wx.CheaterProtection = true -- Triggers a function when a cheater tries to trigger an event using executor. Edit your function at server/ds_editable.lua

wx.DrugFields = { -- You can add how many drug fields you want

    ["Weed Field"] = { -- Field name, this name will be used as blip name (if enabled)
        blip = { -- Blip settings
            enabled = true,
            sprite = 514,
            color = 11
        },
        position = vec3(2222.8909, 5576.9033, 53.8270), -- Position (center) of the field, this is where the blip will be added
        drugModel = `prop_weed_02`, -- Drug model
        drugItem = "weed_leaf", -- Item players will receive upon harvesting
        drugCount = {1,5}, -- [{min,max}] -- Item count
        drugRadius = 25.0, -- Radius where the drugs will spawn
        propCount = math.random(50,80), -- Maximum count of props that can be spawned in specified area
        requiredItem = false, -- Required item for picking the drug. Set to false to disable
        requiredItemCount = 1, -- Required item count, ignore if requiredItem above is set to false.
        targetIcon = "fa-solid fa-cannabis",
        progressTime = math.random(5000,8000), -- How long should the progress bar when picking the drug take
        animation = { dict = 'mp_arresting', clip = 'a_uncuff' }, -- Progress bar animation
        locale = { -- You can change the locale text here
            target = "Pick Weed",
            progress = "Picking weed..."
        }
    },
    ["Coke Field"] = { -- Field name, this name will be used as blip name (if enabled)
        blip = { -- Blip settings
            enabled = true,
            sprite = 140,
            color = 16
        },
        position = vec3(5207.6763, -5048.4521, 13.7471), -- Position (center) of the field, this is where the blip will be added
        drugModel = `h4_prop_bush_cocaplant_01`, -- Drug model
        drugItem = "coke", -- Item players will receive upon harvesting
        drugCount = {1,5}, -- [{min,max}] -- Item count
        drugRadius = 25.0, -- Radius where the drugs will spawn
        propCount = math.random(50,80), -- Maximum count of props that can be spawned in specified area
        requiredItem = false, -- Required item for picking the drug. Set to false to disable
        requiredItemCount = 1, -- Required item count, ignore if requiredItem above is set to false.
        targetIcon = "fa-solid fa-pills",
        progressTime = math.random(5000,8000), -- How long should the progress bar when picking the drug take
        animation = { dict = 'mp_arresting', clip = 'a_uncuff' }, -- Progress bar animation
        locale = { -- You can change the locale text here
            target = "Pick coke",
            progress = "Picking coke..."
        }
    }

}

wx.DrugLabs = {
    ["Weed Lab"] = { -- Lab name, this name will be used as blip name (if enabled)
        blip = { -- Blip settings
            enabled = true,
            sprite = 140,
            color = 5
        },
        neededItem = false, -- Set the item needed to enter this lab, or set to false to disable this feature
        positions = {
            entry = vec3(1724.8848, -1470.6031, 113.9419), -- Location for entrance
            exit = vec3(1066.3846, -3183.4141, -39.1636), -- Location for entrance
            interior = vec4(1066.3049, -3183.4141, -39.1635,92.0252), -- vec4(x,y,z,heading) | Location of the interior where player will be teleported
            processing = { -- Positions for processing the drug (you can add multiple locations)
                vec3(1039.2350, -3205.3816, -38.1664),
                vec3(1037.0461, -3203.8147, -38.1719),
                vec3(1034.3291, -3203.8120, -38.1778),
                vec3(1034.6504, -3205.4773, -38.1767),
            },
        },
        locale = {
            enter = "Enter Weed Lab",
            entering = "Entering Weed Lab...",
            exit = "Exit Weed Lab",
            exiting = "Exiting Weed Lab...",
            process = "Process weed",
            processing = "Processing weed"
        },
        processingOptions = { -- You can add your items that player can process in the lab
            -- ["Item Label"]
            ["Joint"] = {
                finalItem = 'weed_joint', -- Item player will get upon processing
                finalItemCount = 1, -- Item amount player will get upon processing
                skillCheck = {'easy', 'easy', 'medium', 'hard'}, {'w', 'a', 's', 'd'}, -- Settings for skill check. https://overextended.dev/ox_lib/Modules/Interface/Client/skillcheck
                description = 'Process a classic weed joint',
                proccessTime = 10000, -- Progress bar time
                processLabel = "Processing joint...",
                processAnimation = { dict = 'mp_arresting', clip = 'a_uncuff' }, -- Progress bar animation
                processProp = { model = `p_amb_joint_01`, pos = vec3(0.013, 0.03, 0.022), rot = vec3(0.0, 0.0, -1.5) }, -- Progress bar prop settings
                neededItems = { -- Needed items for crafting
                    -- ["item"] = count
                    ["empty_bag"] = 1,
                    ["weed_leaf"] = 5,
                }
            },
        }
    },
    ["Coke Lab"] = { -- Lab name, this name will be used as blip name (if enabled)
        blip = { -- Blip settings
            enabled = true,
            sprite = 514,
            color = 5
        },
        neededItem = "coke_card", -- Set the item needed to enter this lab, or set to false to disable this feature
        positions = {
            entry = vec3(-1023.6170, -1614.4656, 5.0874), -- Location for entrance
            exit = vec3(1088.5313, -3187.5459, -38.9934), -- Location for entrance
            interior = vec4(1088.5941, -3187.5061, -37.9935,175.4412), -- vec4(x,y,z,heading) | Location of the interior where player will be teleported
            processing = { -- Positions for processing the drug (you can add multiple locations)
                vec3(1090.2061, -3194.8269, -38.9935),
                vec3(1092.5873, -3194.8311, -38.9935),
                vec3(1095.3157, -3194.8210, -38.9935),
                vec3(1102.2885, -3193.7742, -38.9935),
                vec3(1099.6312, -3194.1768, -38.9935),
            },
        },
        locale = {
            enter = "Enter Coke Lab",
            entering = "Entering Coke Lab...",
            exit = "Exit Coke Lab",
            exiting = "Exiting Coke Lab...",
            process = "Process coke",
            processing = "Processing coke..."
        },
        processingOptions = { -- You can add your items that player can process in the lab
            -- ["Item Label"]
            ["Coke Brick"] = {
                finalItem = 'coke_brick', -- Item player will get upon processing
                finalItemCount = 1, -- Item amount player will get upon processing
                skillCheck = {'easy', 'easy', {areaSize = 60, speedMultiplier = 2}, 'hard'}, {'w', 'a', 's', 'd'}, -- Settings for skill check. https://overextended.dev/ox_lib/Modules/Interface/Client/skillcheck
                description = 'Process a large brick of coke',
                proccessTime = 15000, -- Progress bar time
                processLabel = "Processing coke brick...",
                processAnimation = { dict = 'anim@amb@business@coc@coc_unpack_cut_left@', clip = 'coke_cut_coccutter' }, -- Progress bar animation
                processProp = { model = `prop_cs_business_card`, pos = vec3(0.113, 0.03, 0.022), rot = vec3(0.0, 0.0, -1.5) }, -- Progress bar prop settings
                neededItems = { -- Needed items for crafting
                    -- ["item"] = count
                    ["coke"] = 30,
                }
            },
        }
    }
}

wx.DrugEffects = {
    -- [effect_name] = { options }
    --[[
        Add this to your ox_inventory/data/items.lua under the item you want the effect to work for
        client = {
			export = 'wx_drugs.effect_name'
		}
    ]]
    ["weed_effect"] = {
        cameraShake = 0.3, -- Camera shake strenght when the effect starts
        cameraEffect = "DrugsMichaelAliensFightIn", -- https://pastebin.com/dafBAjs0
        movement = "move_m@drunk@slightlydrunk", -- https://docs.fivem.net/natives/?_0xAF8A94EDE7712BEF
        duration = 30 * 1000, -- Duration of the effect
    }
}