[ESX/QBCORE] Drug Sales (ph-selldrugs)


Idle = 0.00ms, While using = 0.04ms

License System

  • ph-selldrugs using Asset Escrow. To better see how it works, check this post!

How Drug Sales Work?


  • Corner Selling:

Corners are ideal for Street Gangs, they are designed to allow Several People to Sell Drugs in one place. Any attempted sales are sent to the LSPD Central Unit for increased activity in the HIDTA (High Intensity Drug Trafficking Area) area. The corners are available from 16:00/04:00 PM to 06:59/06:59 AM in-game time.

  1. Find the nearest Corner and when you are right next to it, use the /corner command (or the one set in Config.lua) to Start Selling.

  2. You are waiting for a Customer, soon someone will approach you.

  3. When the Client comes to us, the script selects the Type of Drug and the Amount we have with us. At this time we get option to choose Price (Normal - more chance to sell/Higher - less chance to sell)

  4. If the Client is satisfied with your offer he will buy your Drugs, otherwise he will refuse.


  • Area Selling:

Sales in the Area are made for literally everyone. It is based on a Reputation System.

  1. When you are in the Red Zone marked on the Map, use the /selldrugs command (or the one set in Config.lua) to Start Selling.

  2. Go to the Nearest NPC and click [=] to start interaction with him.

  3. A short dialogue takes between you and NPC, meanwhile you offer him your Price (Drug Type Price x Drug Amount x + (Reputation Points x Reputation Price Multiplier)).

  4. After that, the script randomizes the scenarios

  • Client bought Drugs
  • Client notified LSPD
  • Client stole your Drugs (Beat/Kill him to get them back)
  • Client wasn’t interested

Config

Keys = {
    ['ESC'] = 322, ['F1'] = 288, ['F2'] = 289, ['F3'] = 170, ['F5'] = 166, ['F6'] = 167, ['F7'] = 168, ['F8'] = 169, ['F9'] = 56, ['F10'] = 57,
    ['~'] = 243, ['1'] = 157, ['2'] = 158, ['3'] = 160, ['4'] = 164, ['5'] = 165, ['6'] = 159, ['7'] = 161, ['8'] = 162, ['9'] = 163, ['-'] = 84, ['='] = 83, ['BACKSPACE'] = 177,
    ['TAB'] = 37, ['Q'] = 44, ['W'] = 32, ['E'] = 38, ['R'] = 45, ['T'] = 245, ['Y'] = 246, ['U'] = 303, ['P'] = 199, ['['] = 39, [']'] = 40, ['ENTER'] = 18,
    ['CAPS'] = 137, ['A'] = 34, ['S'] = 8, ['D'] = 9, ['F'] = 23, ['G'] = 47, ['H'] = 74, ['K'] = 311, ['L'] = 182,
    ['LEFTSHIFT'] = 21, ['Z'] = 20, ['X'] = 73, ['C'] = 26, ['V'] = 0, ['B'] = 29, ['N'] = 249, ['M'] = 244, [','] = 82, ['.'] = 81,
    ['LEFTCTRL'] = 36, ['LEFTALT'] = 19, ['SPACE'] = 22, ['RIGHTCTRL'] = 70,
    ['HOME'] = 213, ['PAGEUP'] = 10, ['PAGEDOWN'] = 11, ['DEL'] = 178,
    ['LEFT'] = 174, ['RIGHT'] = 175, ['TOP'] = 27, ['DOWN'] = 173,
}

ph7 = {}

ph7.Prefix = ESX -- Prefix of your Framework
ph7.TriggerPrefix = "esx" -- Prefix of your triggers Framework
ph7.Colors = {r = 255, g = 66, b = 93} -- Colors of DrawTexts, Markers etc.
ph7.Drugs = { -- Here you can add any Drugs you want
    "cocaine",
    "weed",
    "meth",
    "crack",
}
ph7.DrugsPrice = { -- Here you can configure price for Drugs
    ["cocaine"] = 50,
    ["weed"] = 20,
    ["meth"] = 35,
    ["crack"] = 45,
}
ph7.PoliceJobName = "police" -- Name of the job that will receive Notifications about Drug Sales etc.

function ph7Notifications(Status, arg1, arg2, arg3) -- Here you can customize Notifications to your needs
    if Status == "CStartCommand" then
        exports['mythic_notify']:DoCustomHudText("success", "You started Selling Drugs at the Corner.", 5000)
    elseif Status == "CStopCommand" then
        exports['mythic_notify']:DoCustomHudText("inform", "You stopped Selling Drugs at the Corner.", 5000)
    elseif Status == "CYouDontHaveDrugs" then
        exports['mythic_notify']:DoCustomHudText("error", "You can't start Selling Drugs at the Corner without Drugs.", 5000)
    elseif Status == "CTooFarFromCorner" then
        exports['mythic_notify']:DoCustomHudText("error", "You are too Far from the Corner.", 5000)
    elseif Status == "CTime" then
        exports['mythic_notify']:DoCustomHudText("error", "Corners are available from 16:00 to 06:59.", 2500)
    elseif Status == "CNotEnoughCops" then
        exports['mythic_notify']:DoCustomHudText("error", "On the Server must be at least "..Corner.MinLSPDToStartSale.." Cops to start Selling Drugs at the Corner.", 5000)
    elseif Status == "CLeaveVehicle" then
        exports['mythic_notify']:DoCustomHudText("error", "If you want start to Selling Drugs at the Corner, you have to Leave Vehicle.", 5000)
    elseif Status == "CCantDoThis" then
        exports['mythic_notify']:DoCustomHudText("error", "You can't do that now.", 5000)
    elseif Status == "CClientComing" then
        exports['mythic_notify']:DoCustomHudText("inform", "Someone going in your way...", 2500)
    elseif Status == "CSelledDrugs" then
        exports['mythic_notify']:DoCustomHudText("success", "You sold "..arg1.." for "..tostring(math.floor(arg2)).."$.", 5000)
    elseif Status == "CNotSelledDrugs" then
        exports['mythic_notify']:DoCustomHudText("error", "Your Client didn't like your offer.", 5000)
    elseif Status == "CNotSelledDrugsWithHigherPrice" then
        exports['mythic_notify']:DoCustomHudText("error", "Client didn't like your price for Drug.", 5000)
    elseif Status == "CNotifyForCops" then
        exports['mythic_notify']:DoCustomHudText("error", "[HIDTA] On the "..arg1.." area is populated more than usual. Location has been added to the GPS.", 5000)
    elseif Status == "NLeaveVehicle" then
        exports['mythic_notify']:DoCustomHudText("error", "If you want start to Selling Drugs to NPC, you have to Leave Vehicle.", 5000)
    elseif Status == "NTooFarFromArea" then
        exports['mythic_notify']:DoCustomHudText("error", "You are too Far from the Nearest Area.", 5000)
    elseif Status == "NNotEnoughCops" then
        exports['mythic_notify']:DoCustomHudText("error", "On the Server must be at least "..NPC.MinLSPDToStartSale.." Cops to start Selling Drugs at the Area", 5000)
    elseif Status == "NYouDontHaveDrugs" then
        exports['mythic_notify']:DoCustomHudText("error", "You can't start Selling Drugs to NPC without Drugs.", 5000)
    elseif Status == "NStartCommand" then
        exports['mythic_notify']:DoCustomHudText("success", "You started Selling Drugs in the Nearest Area.", 5000)
    elseif Status == "NStopCommand" then
        exports['mythic_notify']:DoCustomHudText("inform", "You stopped Selling Drugs in the Nearest Area.", 5000)
    elseif Status == "NSelledDrugs" then
        exports['mythic_notify']:DoCustomHudText("success", "You sold "..arg1.." for "..tostring(math.floor(arg2)).."$. Your reputation is "..arg3.." points.", 5000)
    elseif Status == "NNotifyForCops" then
        exports['mythic_notify']:DoCustomHudText("error", "[HIDTA] On the "..arg1.." Area came to Drugs Sales.", 5000)
    elseif Status == "NNotifyCops" then
        exports['mythic_notify']:DoCustomHudText("inform", "The Client made a strange call, Be careful.", 5000)
    elseif Status == "NStealDrugs" then
        exports['mythic_notify']:DoCustomHudText("inform", "Client stole you "..arg1.."g of "..arg2..", beat him to get them back!", 5000)
    elseif Status == "NGetBackDrugs" then
        exports['mythic_notify']:DoCustomHudText("success", "You got your Drugs back, Be more careful next time!", 5000)
    elseif Status == "NNotGetBackDrugs" then
        exports['mythic_notify']:DoCustomHudText("error", "You didn't get your Drugs back, Be careful next time!", 5000)
    elseif Status == "NNotInterested" then
        exports['mythic_notify']:DoCustomHudText("error", "The Client is not interested in your offer.", 5000)
    end
end

ph7.UseCustomDrawTextMessages = false -- (true/false) - If value are set to True script is using DrawTexts with messages from Below
ph7.DrawTextCustomMessages = {
    Of = "g ~w~of~s~ ",
    For = "~w~ for...~s~",
    Corner = {
        NotCornerSelling = "~w~To start ~s~Selling Drugs~w~ at the Corner, say ~s~/corner",
        CornerSelling = "In the area ~w~where you are standing walking much ~s~potential customers",
        ClientCameToYou = "Client ~w~came to you, let him check your ~s~offer",
        CornerRandomText = { -- Random Text when you're offering drugs to NPC (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~'sup, i can offer you~s~",
            "~w~Yo'w, i got for you~s~",
        },
        NormalPriceText = "~w~Normal Price~s~",
        HigherPriceText = "~w~Higher Price~s~",
        CornerTime = "~w~Corners are available from ~s~16:00~w~ to ~s~06:59",
        ClientGoingToYou = "Client ~w~going to you...~s~",
    },
    NPC = {
        StartInteraction = "[=]~w~ - Start Interaction with Potential Client~s~",
        ClientGoingToYou = "Client ~w~going to your way...~s~",
        PedRandomText = { -- Random Text when Ped talking with you about Drugs (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~Hi, show me your offer Buddy~s~",
        },
        YourRandomText = { -- Random Text when you're talking with Ped about Drugs (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~'sup, i can offer you~s~",
            "~w~Yo'w, i got for you~s~",
        },
        NormalPriceWithEXPText = "~w~Normal Price~s~",
        Buy = { -- Random Text when NPC talking with us after Buy (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~OK, thank you Buddy~s~",
            "~w~It's looks nice, thank you~s~",
        },
        NotifyCops = { -- Random Text when NPC talking with us after offer to Buy (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~Uhh... It's not for me~s~",
            "~w~I don't want that shit~s~",
        },
        StealDrugs = { -- Random Text when NPC steal our Drugs (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~You wanna Sell Drugs on my Street? Motherfucker!~s~",
            "~w~phahaha! You're biggest loser in 'Santos!~s~"
        },
        NotInterested = { -- Random Text when NPC are not interested in our offer (working without "Corner.UseCustomDrawTextMessages" option). You can add here more random texts
            "~w~I don't want it, sorry~s~",
            "~w~Sell it to someone else...~s~",
        },
    },
}
----------------------------------------------------------------------------------- CORNER CONFIG
Corner = {}

Corner.CommandName = "corner" -- Name of Command that activate Selling on Corner
Corner.SalesForBlackMoney = true -- (true/false) - If value are set to True script is giving Black Money for Drugs
Corner.HigherPriceMultiplier = 1.2 -- Drug Type Price * Drug Amount * Corner.HigherPriceMultiplier = Higher Price
Corner.MinWaitingForClientTime = 15 -- Set time in seconds
Corner.MaxWaitingForClientTime = 30 -- Set time in seconds
Corner.MinLSPDToStartSale = 0 -- Minimum online Cops to Start Selling Drugs on Corner
Corner.Days = { -- Script is randomly getting "Day" (with each Script Start/Restart). If it get higher value, this will improve the chance of Selling Drugs on Corner
    [1] = {PercentsToSell = 60},
    [2] = {PercentsToSell = 40},
}
Corner.BlipForCops = {
    Sprite = 403, -- https://docs.fivem.net/docs/game-references/blips/
    Colour = 1, -- Below Blips Sprite Category https://docs.fivem.net/docs/game-references/blips/
    Alpha = 1000,
    Scale = 0.8,
    BlipText = "[HIDTA] Place of Drug Sale", -- Blip Name for Cops
    RemoveBlipTime = 15 -- Set time in seconds
}
Corner.Places = { -- Here you can Add more places for Corners! (X,Y,Z - Place of Corner | NPCX,NPCY,NPCZ, NPCH - Place where Ped will be spawned (NPCH is Heading!!!))
    {x = -164.56, y = -1631.36, z = 33.66, npcx = -154.02, npcy = -1627.01, npcz = 33.65, npch = 79.15, npc, usingCorner = false},
    {x = 79.70, y = -1908.02, z = 21.34, npcx = 98.93, npcy = -1914.68, npcz = 21.02, npch = 157.76, npc, usingCorner = false},
    {x = 322.38, y = -2016.29, z = 21.17, npcx = 335.29, npcy = -2010.07, npcz = 22.31, npch = 48.32, npc, usingCorner = false},
}
-----------------------------------------------------------------------------------
----------------------------------------------------------------------------------- NPC SALES CONFIG
NPC = {}

NPC.CommandName = "selldrugs" -- Name of Command that activate Selling in Nearest Area
NPC.SalesForBlackMoney = true -- (true/false) - If value are set to True script is giving Black Money for Drugs
NPC.ReputationMultiplier = 0.1 -- Drug Type Price * Drug Amount + (Number of your Reputation * NPC.ReputationMultiplier) = Price for Drugs
NPC.MaxDistanceFromArea = 250.0 -- The size of the Drug Sales zone
NPC.MinLSPDToStartSale = 0 -- Minimum online Cops to Start Selling Drugs in Nearest Area
NPC.MaxTimeFightWithStealer = 10 -- Maximum time we have to beat/kill a Ped which stolen our Drugs (Set time in seconds)
NPC.Blips = {
    RadiusBlip = {
        Colour = 1, -- Below Blips Sprite Category https://docs.fivem.net/docs/game-references/blips/
        Alpha = 75,
    },
    SaleBlip = {
        Sprite = 403, -- https://docs.fivem.net/docs/game-references/blips/
        Colour = 1, -- Below Blips Sprite Category https://docs.fivem.net/docs/game-references/blips/
        Alpha = 1000,
        Scale = 0.8,
        BlipText = "[HIDTA] Place of Drug Sale", -- Blip Name for Cops
        RemoveBlipTime = 15 -- Set time in seconds
    },
}
NPC.ChooseRandomlyPercentage = { -- Scirpt is getting percents from 0 to 100!!! Example Below...
    Buy = 60, -- 100 - Buy(60) = 40% chance for Scenario with Normal Drug Sale
    NotifyCops = 40, -- Buy(60) - NotifyCops(40) = 20% chance for Scenario with Client Notifies Cops
    StealDrugs = 35, -- NotifyCops(40) - StealDrugs(35) = 5% chance for Scenario with Ped Stealing our Drugs
    NotInterested = 0, -- StealDrugs(35) - NotInterested(0) = 35% chance for Scenario with Ped are not interested in our offer
}
NPC.Areas  = { -- Here you can Add more places for Selling Drugs! (X,Y,Z - Coords of Area)
    {x = 237.19, y = 164.47, z = 105.10, BlipRadius, usingArea = false},
    {x = -233.77, y = -642.95, z = 32.82, BlipRadius, usingArea = false},
    {x = 243.75, y = -1653.58, z = 28.65, BlipRadius, usingArea = false},
}
-----------------------------------------------------------------------------------

Preview

Buy Here

Code is accessible Only Config.lua
Subscription-based No
Lines (approximately) ~1600
Requirements ESX/QBCore
Support Yes
3 Likes

if this scirpt is accessible with QS-inventory ! i buy it instantly !

but lot of script dont work because getinventory is not really working and Quasar use Metadata files for inventory.

1 Like

Hi, unfortunately the script only works with Basic Framework inventories. ;(

1 Like

video not working

2 Likes

and ox don’t use it… bruh
Sure it is use it, but quasar is little 2HEad

2 Likes

Check that link, it works for me.

3 Likes

dus it work whit chezza ivertorty v3

2 Likes

We have no idea how Chezza Inventory works, contact us - we’ll see what we can do!
We also want to inform everyone about the currently available Discount on our Tebex Store.

An update for ph-selldrugs is also coming soon!

2 Likes

it works nice and smooht no erros nhoting nice job but i cant get my customer roll in discord

1 Like

Hi paramoney, thank you for the nice words! We are glad that you are satisfied with your purchase. As for your rank, you already have it. :wink:

1 Like

can you make this work with out MythicNotify >?

2 Likes

It’s already working without mythic_notify - just configure your notifications in Config.lua (ph7Notifications). If you have any questions or need any help, feel free to write us!

1 Like

works with oxinventory?

Hi, script is adapted to Basic Framework Inventory.

sdfasdfasdfas

Do you have any idea why it is giving cents?

1 Like

Have you noticed getting stuck in the corner circle? If PD comes you are stuck there and cannot get out of sale.

is there any way to turn off the red circle while corner selling and is it possible to set the an item to trigger the command of the corner selling i will prolly use the corner selling part only im using qbcore framework

Hi, is there a way where people could do corner selling anywhere on the map? rather than having to set a specific corner?