|
| 1 | +--- |
| 2 | +title: it-drugs - Selling |
| 3 | +description: With the update v1.1.0 it is now also possible to sell drugs to NPCs in certain zones with the script. |
| 4 | +--- |
| 5 | + |
| 6 | +import {Tabs} from 'nextra/components' |
| 7 | +import {Callout} from '@components/Callout' |
| 8 | +import ExternLink from '@components/ExternLink' |
| 9 | +import Accordion from '@components/Accordion' |
| 10 | +import AccordionGroup from '@components/AccordionGroup' |
| 11 | + |
| 12 | +# 💵・Selling |
| 13 | +With the update v1.1.0 it is now also possible to sell drugs to NPCs in certain zones with the script. |
| 14 | + |
| 15 | +To be able to use this feature, `Config.EnableSelling` must be set to **true** in the Config! |
| 16 | + |
| 17 | +## Config.SellSettings |
| 18 | +Here you will find the most important settings for selling. These settings apply to all zones. |
| 19 | + |
| 20 | +## Config.SellZones |
| 21 | +The individual zones can be created and edited here. We will now take a closer look at one zone and explain what the individual values mean and what they change. |
| 22 | + |
| 23 | +```lua |
| 24 | +['groove'] = { |
| 25 | + points = { |
| 26 | + vec3(-154.0, -1778.0, 30.0), |
| 27 | + vec3(48.0, -1690.0, 30.0), |
| 28 | + vec3(250.0, -1860.0, 30.0), |
| 29 | + vec3(142.0, -1993.0, 30.0), |
| 30 | + vec3(130.0, -2029.0, 30.0), |
| 31 | + }, |
| 32 | + thickness = 27, |
| 33 | + drugs = { |
| 34 | + { item = 'cocaine', price = math.random(100, 200), moneyType = 'cash'}, |
| 35 | + { item = 'joint', price = math.random(50, 100) = moneyType = 'bank'}, |
| 36 | + { item = 'weed_lemonhaze', price = math.random(50, 100), = 'black_money'} |
| 37 | + } |
| 38 | +}, |
| 39 | +``` |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +```lua |
| 44 | +['groove'] |
| 45 | +``` |
| 46 | +We start with the zone id, this specifies the name of the zone, the name is only relevant for the script. The zone id must not contain any special characters or spaces and must be unique |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +```lua |
| 51 | +points = { |
| 52 | + vec3(-154.0, -1778.0, 30.0), |
| 53 | + vec3(48.0, -1690.0, 30.0), |
| 54 | + vec3(250.0, -1860.0, 30.0), |
| 55 | + vec3(142.0, -1993.0, 30.0), |
| 56 | + vec3(130.0, -2029.0, 30.0), |
| 57 | +}, |
| 58 | +thickness = 27, |
| 59 | +``` |
| 60 | + |
| 61 | +<Callout type="warning"> |
| 62 | +**Make sure that all z coordinates (laste number) are the same, otherwise the zone will not be created.** |
| 63 | +</Callout> |
| 64 | + |
| 65 | +The points define the area of the zone. A straight line is drawn between two consecutive `vec3()` or `vec()` to define the edge of the zone. |
| 66 | +A line is also automatically drawn between the last and first `vec3()`. |
| 67 | + |
| 68 | +The thickness can be left at 4 if the zone is created manually. |
| 69 | +However, since the script now uses ox_lib for the zones, this can also be created more easily. |
| 70 | +You can find more information here: |
| 71 | + |
| 72 | +<ExternLink href="https://help.it-scripts.com/scripts/it-drugs/tipps-and-tricks/easy-zone-creation" /> |
| 73 | + |
| 74 | +As soon as a player enters this zone he has the possibility to sell items to the NPCs. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +```lua |
| 79 | +drugs = { |
| 80 | + { item = 'cocaine', price = math.random(100, 200), moneyType = 'cash'}, |
| 81 | + { item = 'joint', price = math.random(50, 100) = moneyType = 'bank'}, |
| 82 | + { item = 'weed_lemonhaze', price = math.random(50, 100), = 'black_money'} |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +Here you can specify which drugs can be sold in the zone. |
| 87 | +Theoretically, an infinite number of items can be added. For many items it is recommended to set Config.asdasd to true. |
| 88 | + |
| 89 | +**Schemata for new items:** |
| 90 | +```lua copy |
| 91 | +{ item = 'item_name', price = math.random(min_price, max_price), moneyType = 'cash/bank/black_money'}, |
| 92 | +``` |
| 93 | + |
| 94 | +<AccordionGroup> |
| 95 | + <Accordion title="Available Money Types"> |
| 96 | + - cash (Money in the players inventory) |
| 97 | + - bank (Money in the players bank accout) |
| 98 | + - black_money (Black Money) |
| 99 | + |
| 100 | + **Please keep in mind `black_money` is no default account on qb-core!** |
| 101 | + |
| 102 | + ```lua |
| 103 | + ['cash'] = { |
| 104 | + ['qbcore'] = 'cash', |
| 105 | + ['esx'] = 'money', |
| 106 | + ['ND_Core'] = 'cash' |
| 107 | + }, |
| 108 | + ['bank'] = { |
| 109 | + ['qbcore'] = 'bank', |
| 110 | + ['esx'] = 'bank', |
| 111 | + ['ND_Core'] = 'bank' |
| 112 | + }, |
| 113 | + ['black_money'] = { |
| 114 | + ['qbcore'] = 'black_money', |
| 115 | + ['esx'] = 'black_money', |
| 116 | + ['ND_Core'] = nil -- Will be added soon |
| 117 | + } |
| 118 | + ``` |
| 119 | + </Accordion> |
| 120 | +</AccordionGroup> |
0 commit comments