Installation
Five minutes. No SQL, no item file to import: what you need is lb-phone, one line in config.lua, and drugs in your inventory that the app can sell.
Before you start
Section titled “Before you start”| You need | Why |
|---|---|
| lb-phone | The app lives on it, and every notification goes through it |
| ESX, QBCore or QBox | Inventory, money, jobs and the player’s identity |
| Drug items in your inventory | The app sells what players carry; it does not create items |
1. Put the folder in place
Section titled “1. Put the folder in place”Drop mic_drugdealer into your resources, for example resources/[mic]/mic_drugdealer.
2. Start it after lb-phone and your framework
Section titled “2. Start it after lb-phone and your framework”In server.cfg, add ensure mic_drugdealer on a line below your framework and below lb-phone.
The app waits for lb-phone and adds itself again whenever lb-phone restarts, so the order is forgiving, but the framework must be up first: the server side asks for it the moment it starts.
3. The database — nothing to do
Section titled “3. The database — nothing to do”Levels and sale counts are saved in player_data.json in the resource folder. The resource creates it if it is missing. Your server must be allowed to write to that folder.
4. Tell it your framework
Section titled “4. Tell it your framework”This one is not detected. Open config.lua and set Config.Framework:
| Your framework | Value |
|---|---|
| ESX | "ESX" |
| QBCore | "QB" |
| QBox | "QB" |
Capitals matter. If your framework’s resource has a custom name, change Config.esxResourceName or Config.qbResourceName to match; otherwise leave them alone.
On QBox, use "QB" and leave Config.qbResourceName on "qb-core": QBox runs QBCore resources through its compatibility layer, and qbx_core provides qb-core.
5. The items
Section titled “5. The items”The resource does not ship item definitions: it sells items your inventory already knows. The shipped config expects these names:
| Item | Sold as | Zones | Level |
|---|---|---|---|
maria | Weed | Grove | 1 |
coca | Coke | Pier, Paleto | 3 |
lsd | LSD | Grove, Pier, Vinewood | 2 |
meta | Meth | Sandy, Paleto | 4 |
mush | Mushroom | Grove, Sandy | 2 |
opium | Opium | Paleto | 1 |
crack | Crack | Grove, Sandy | 3 |
heroin | Heroin | Sandy, Paleto | 5 |
xtc | Ecstasy | Pier, Vinewood | 2 |
oxy | Oxycontin | Vinewood, Sandy | 3 |
lean | Lean | Grove, Pier | 1 |
hash | Hash | Grove, Vinewood | 2 |
Your drugs are probably called something else. Change the item field of each entry in Config.drugs to match your inventory, rather than creating new items — see Customization.
The money items matter too:
- ESX with
Config.MoneyAsItem = truepaysblack_money(orConfig.MoneyItemwhen black money is off) as an item — right for ox_inventory. - QBCore pays black money as an item called
blackmoney. Make sure that item exists, or switchConfig.BlackMoneyoff.
The pictures in ui/img/ are the app’s own drug icons. They are plain PNGs, so you may copy them into your inventory’s image folder if you want the same look there.
6. First test
Section titled “6. First test”- Put
Config.MinimumPolice = 0for the test — the shipped value is1, and nobody buys with no police online. - Join with a job that is not in
Config.BlockedAppJobs(police, sheriff, ambulance and mechanic are). - Open lb-phone, find Drug Dealer in the App Store and install it.
- Give yourself a few
maria, open the app, tap DRUGS, then Weed, then SELL.
It worked when a red route appears on the map with a countdown in the app. Drive there, walk up to the door marker and press E: the player knocks, a buyer steps out, and the phone says what you sold and for how much. PROFILE now shows one sale.
Before you open your city
Section titled “Before you open your city”- Set
Config.MinimumPoliceback to what your city wants. - Clear the test progress.
player_data.jsonships with example entries and keeps yours from testing. Delete the file; the resource creates an empty one on its next start. - Match every
itemname inConfig.drugsto your inventory. A drug nobody can carry is a button that only ever says “You don’t have enough”. - Check the money item for your framework, above.
- Check
Config.BlockedAppJobsandConfig.PoliceJobsuse your job names.