The first step is to download the product we have just purchased. To do this we will go to our account and search for "BCall_SellToNPC".
2. DATABASE
3. CONFIG
The following will explain all the settings, one of the most important things that I recommend you spend a few minutes to understand in order to offer your users the best possible experience.
The following file is located at: Buty-SellDrugs\configs\config.lua
Configuration = {
[1] = {
framework = 'esx', -- framework "esx", "oldesx" or "qbcore"
ESXtrigger = 'es_extended',
QBtrigger = 'qb-core'
},
[2] = {
Mysql = 'oxmysql' -- oxmysql, mysql-async or ghmattisql
},
[3] = {
alertpolice = true,
MinPoliceToSell = 0,
WithCommand = false,
SellCommand = "selldrugs",
CancelSellCommand = 'cancelselldrugs'
},
[4] = {
UseTarget = false,
TargetExport = 'bt-target',
Text = 'SELL DRUGS',
Icon = 'fa fa-shopping-cart'
},
[5] = {
DrawText = true,
custompolicealert = false
},
[6] = {
BattlePass = false,
EXP = 10
}
}
Policejob = { -- Here all the police jobs you use, such as FBI, Sheriffs etc.
"police",
--"police",
--"police",
}
BlacklistPed = {
"u_m_m_jewelsec_01",
}
ByZone = {
SellByZone = false, -- You will activate the sale by zone, you can add as many zones as you want.
{
x = 192.8, y = -2274.44, z = 32.72, -- Coords
SizeZone = 50.0, -- Size
},
{
x = -1201.24, y = -1568.88, z = 4.6,
SizeZone = 50.0,
},
}
Street = {
{[1] = {name = "Bay City Avenue", moneyextra = 300}},
{[1] = {name = "Palomino Avenue", moneyextra = 400}},
}
4. ADD/CONFIGURE NEW DRUGS
Now I will show you how to add new drugs and explain each configuration.
The following file is located at: Buty-SellDrugs\configs\drugs.lua
EXPLANATION OF DRUG CONFIGURATION
Drugs = {
{
[1] = {
ItemLabel = "COCAINE", -- Item label
ItemName = "cocaine", -- Item name
ItemImg = "./img/cocaine_cut.png" }, -- Item Image (You must add the image to the Buty-SellDrugs\html\img folder.)
[2] = {
Pricerandom = false, -- Do you want the price to be random?
PriceRandomMin = 100, -- Random amount MIN on the number you add
PriceRandomMax = 400, -- Random amount MAX on the number you add
PriceDrug = 1001, -- Price per drug
exp = 5, -- Experience per drug
TypeAccount = "black_money", -- Type of account where payment is made
MaxSellDrug = 50 -- Maximum amount of drugs that can be sold to each npc.
},
[3] = {
SellForItem = false, -- Is your money an item?
SellForItemName = "money" -- Name Item
},
[4] = {
Steal = true, -- Do you want the npc to be able to steal from you?
StealProbability = 50, -- Probability of being robbed (The lower the number, the more likely you are to be robbed).
PoliceMin = 1, -- Minimal police for this drug to be shown in the UI
Probabilitycallpolice = 20, -- Probability of calling the police (The lower the number, the more likely they are to call).
TimeDecision = 5000, -- Time it will take the NPC to decide
BuyProbability = 40 -- Probability that the NPC will buy you (The lower the number, the more likely it is that he/she will not buy you).
},
[5] = {
IncreasePerLVL = 200, -- Increase money per LVL
IncreasePerPolice = 10, -- Increase money per LVL
IncreasePerLVLEXP = 10, -- Increase experience per LVL
IncreasePerPoliceEXP = 5 -- Increase experience per LVL
},
},
}
CREATE A NEW DRUG
To create a new drug we will only have to copy one of the ones we have already created and paste it below in the following way: