Adding Custom Drugs

Each drug you add will be done so under the Config.Drugs setting. Below is an example of two drugs added

['cokebaggy'] = {
    label = 'Coke',
    basePrice = 150,
    minPrice = 100,
    maxPrice = 220,
    maxSale = 5,
    amountType = 'gram',
    prop = 'p_meth_bag_01_s',
    propOffset = vec3(0.0, 0.0, 0.0),
    propRot = vec3(0.0, 320.0, 0.0),
    largePackage = false,
    highDemandZones = { 0, 1, 2, 3 },
    soldToNpcs = true,
    timeBetweenSales = 20,
},
['coke_7g'] = {
    label = 'Coke',
    basePrice = 550,
    minPrice = 350,
    maxPrice = 750,
    maxSale = 3,
    amountType = 'quarter-ounce',
    prop = 'p_meth_bag_01_s',
    propOffset = vec3(0.0, 0.0, 0.0),
    propRot = vec3(0.0, 320.0, 0.0),
    largePackage = false,
    highDemandZones = { 1, 2, 3 },
    soldToNpcs = true,
    timeBetweenSales = 45,
},

And here's what the corresponding items would look like in your inventory (example is for ox_inventory, but you should get the idea for other inventories)

['cokebaggy']             = {
    label = 'Bag of Coke',
    weight = 100,
    stack = true,
    close = true,
},
["coke_7g"]                        = {
    label = "7g Bag of Coke",
    weight = 0,
    stack = true,
    close = true,
},
  • The text between the square brackets [] is the item spawn name

    • These must all be unique!

    • These items must be in your items.lua file

  • NOTE: The label field is the same for both in the above config!

    • This config allows you to specify different "amounts" of drugs that can be split up using the scales item

    • In order for the script to know these drugs are related, the label field must match for different amounts

    • The amountType field shows that the top one is a gram of coke, whereas the bottom on is a quarter ounce of coke

    • There are four valid amount types

      • gram

      • quarter-ounce

      • ounce

      • kilo

    • This means that you can have at most four values in the config with the same label, but all with different item names and amounts

  • The rest should be relatively self explanatory, and several have extra comments in the config file itself. The above is just what we get the most questions about

Last updated