AI Core

ai-drugs

Street drug sales to strangers, switched on from the radial menu, and weed plants that grow over time and are saved in the database.

ai-drugs gives players two ways to make money with drugs: selling to strangers on the street, and growing weed. The server decides every sale (price, refusal, police alert), and plants are saved in the database, so they keep growing through restarts.

What it does in the game

Street sales

  1. Open the radial menu and pick Sell drugs to start looking for buyers. Pick it again to stop.
  2. While selling, a stranger from nearby walks up to you. A Sell to the stranger prompt appears when they stand next to you.
  3. The server picks one drug you carry from the panel's list, a count and a price in that drug's range. The buyer may refuse (Refuse chance). The money goes to the panel's money account.
  4. A sale may alert the police (Police alert chance). Nobody buys while fewer than Police needed officers are on duty.

A player cannot sell more often than Time between sales, and the same stranger does not buy again for 10 minutes.

Weed plants

  1. Use a weed_seed outside to plant a weed plant. Plants cannot stand within 2 m of each other, and one character can have at most Plants per character plants.
  2. The plant grows over Growing time: a young prop, a growing prop from 40 %, a ready prop at the end. The prompt shows the growth in percent.
  3. Anyone can harvest a ready plant: a progress bar, then a random number of weed_bud between Buds from and Buds up to.
  4. On-duty police can destroy a growing plant.
  5. A ready plant that nobody harvests disappears after Rots after.

Installation

Installed by the AI Core recipe. By hand: ensure ai-drugs after ensure ai-core. It needs ai-core and OneSync.

  • It stores plants in its own table ai_drugs_plants, created at start. It needs its database permission line in env.cfg:
env.cfg
add_convar_permission ai-drugs read mysql_connection_string
  • Items used by the defaults: weed_seed (usable), weed_bud, coke_baggy, meth_baggy. ai-inventory has them; with another inventory, add them or change the panel.
  • The Sell drugs item shows on whichever radial menu AI Core supports.

Panel settings

Admin panel > Drugs. Defaults come from data/settings.json and data/plants.json. The Street sales and Weed plants settings stay on the server.

Street sales tab

Players sell to strangers after turning selling on in the radial menu.

SettingWhat it changesUnitDefault
DrugsUp to 30 rows, each an Item with Price from and Price up to (0-1,000,000). A sale is priced between the two.$weed_bud $40-80, coke_baggy $90-160, meth_baggy $120-200
Time between salesOne player cannot sell more often than this. 1-600.s10
Refuse chanceChance a buyer says "Not interested". 0-100.%20
Police alert chanceChance that a sale alerts on-duty police. 0-100.%20
Police neededOn-duty officers needed before anyone buys. 0-32.0
Police jobsOn-duty members count as police and can destroy plants. Up to 10.police
Money accountSale money goes to this account.cash

Weed plants tab

Anyone can harvest a ready plant; police destroy growing ones.

SettingWhat it changesUnitDefault
Growing timeHow long a plant takes to be ready. 1-10,080.min60
Rots afterA ready plant nobody harvests disappears after this long. 1-10,080.min120
Plants per characterHow many plants one character can have at once. 0-100.5
Buds fromFewest buds per harvest. 1-100.3
Buds up toMost buds per harvest. 1-100.8
Seed itemUsing this item plants a weed plant. A new item works at once.weed_seed
Harvest itemA ready plant gives this item.weed_bud

Plant look tab

The props players see while a plant grows.

SettingWhat it changesUnitDefault
Young plantProp until 40 % growth.bkr_prop_weed_01_small_01c
Growing plantProp from 40 %.bkr_prop_weed_med_01a
Ready plantProp when it can be harvested.bkr_prop_weed_lrg_01a
Draw distancePlants further away than this have no prop. 20-300.m100

Commands

None.

Keybinds

None. Selling starts from the radial menu (Sell drugs). Buyers and plants use prompts (E by default).

What it stands in for

No fxProvide. It does not answer another drug script's exports or events.

Compatible scripts

Items go through AI Core's inventory layer, police alerts through the dispatch layer, the sell switch through the radial layer. Any inventory, alert script and radial menu AI Core supports works (see Compatibility).

Known limits

  • Only weed grows; coke and meth are sold, not made.
  • Growth is time only: there is no water or fertilizer.
  • Log channel: drugs.

On this page