|
| 1 | +--- |
| 2 | +title: it-crafting - Crafting Points |
| 3 | +description: So let's start setting up the Crafting Tables. |
| 4 | +--- |
| 5 | + |
| 6 | +import {Tabs} from 'nextra/components' |
| 7 | +import ExternLink from '@components/ExternLink' |
| 8 | +import Accordion from '@components/Accordion' |
| 9 | +import AccordionGroup from '@components/AccordionGroup' |
| 10 | +import { IconExternalLink } from '@tabler/icons-react'; // Importiere das Tabler-Icon |
| 11 | +import { Callout } from '@components/Callout' |
| 12 | + |
| 13 | +# 📍・Crafting Points |
| 14 | +So let's start setting up the crafting points. Crafting points are static points where the player can craft items. |
| 15 | + |
| 16 | +## Config.CraftingPoints |
| 17 | +The individual processing points can now be configured here: |
| 18 | + |
| 19 | +```lua |
| 20 | +['crafting_point_one'] = { |
| 21 | + zone = vector3(2.0, 1.0, 2.0), |
| 22 | + label = 'Crafting Point', -- Label for the table |
| 23 | + model = 'v_res_tre_table2', -- Exanples: freeze_it-scripts_empty_table, freeze_it-scripts_weed_table, freeze_it-scripts_coke_table, freeze_it-scripts_meth_table |
| 24 | + restricCrafting = { |
| 25 | + ['onlyOnePlayer'] = true, -- Only one player can use the table at a time |
| 26 | + ['onlyOwnerCraft'] = false, -- Only the owner of the table can use it |
| 27 | + ['onlyOwnerRemove'] = true, -- Only the owner of the table can remove it |
| 28 | + ['zones'] = {}, -- Zones where the table can be used |
| 29 | + ['jobs'] = {} |
| 30 | + }, |
| 31 | + blip = { |
| 32 | + display = true, -- Display blip on map |
| 33 | + sprite = 446, -- Select blip from (https://docs.fivem.net/docs/game-references/blips/) |
| 34 | + displayColor = 2, -- Select blip color from (https://docs.fivem.net/docs/game-references/blips/) |
| 35 | + displayText = 'Crafting Table', |
| 36 | + }, |
| 37 | + recipes = { |
| 38 | + -- Here you can add as many recipes as you want |
| 39 | + } |
| 40 | + } |
| 41 | +``` |
| 42 | + |
| 43 | +```lua |
| 44 | +['crafting_point_one'] |
| 45 | +``` |
| 46 | +This is the name of the item to which this configuration is bound. The item can now be used to set up a table in the game. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +```lua |
| 51 | +zone = vector3(2.0, 1.0, 2.0), |
| 52 | +``` |
| 53 | +As soon as the player places the table, the script will create a zone around the table. The zone is used to interact with the table. |
| 54 | +The zone has to be defined as a vector3. The first value is the width, the second value is the length, and the third value is the height of the zone. |
| 55 | + |
| 56 | +```lua |
| 57 | +model = 'v_res_tre_table2' |
| 58 | +``` |
| 59 | +The model of the processing table here can theoretically be used with any Fivem model. |
| 60 | +You also can set the model to `nil` if you dont want to use a model. |
| 61 | +Then the script will only create a zone at the position. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +```lua |
| 66 | +restricCrafting = { |
| 67 | + ['onlyOnePlayer'] = true, -- Only one player can use the table at a time |
| 68 | + ['onlyOwnerCraft'] = false, -- Only the owner of the table can use it |
| 69 | + ['onlyOwnerRemove'] = true, -- Only the owner of the table can remove it |
| 70 | + ['jobs'] = {} |
| 71 | +}, |
| 72 | +``` |
| 73 | + |
| 74 | +- `onlyOnePlayer` - As the name suggests, only one player can use the table at a time. |
| 75 | +- `onlyOwnerCraft` - Only the owner of the table can use the table. |
| 76 | +- `onlyOwnerRemove` - Only the owner of the table can remove the table. |
| 77 | +- `jobs` - Jobs that can use the table. |
| 78 | + - If you want to allow all jobs to use the table, you can leave the table empty. |
| 79 | + - If you want to add a job, you can add the job name to the table like this: `['police'] = true`. Now only the police can use the table. |
| 80 | + You also hove the option to add a job with a specific grade like this: `['police'] = {1, 2}`. Now only the police with the grade 1 and 2 can use the table. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +```lua |
| 85 | +blip = { |
| 86 | + display = true, -- Display blip on map |
| 87 | + scale = 1.0, -- Blip scale |
| 88 | + sprite = 446, -- Select blip from (https://docs.fivem.net/docs/game-references/blips/) |
| 89 | + displayColor = 2, -- Select blip color from (https://docs.fivem.net/docs/game-references/blips/) |
| 90 | + displayText = 'Crafting Point', |
| 91 | +}, |
| 92 | +``` |
| 93 | +The blip of the point can be set here. |
| 94 | +If set to `true`, the blip will be displayed on the map to all players. |
| 95 | + |
| 96 | + |
| 97 | +### Recipes |
| 98 | +Each table can theoretically have an infinite number of recipes, how exactly a recipe must look is explained here |
| 99 | +<ExternLink |
| 100 | + href="https://docs.it-scripts.com/it-crafting/adjustments/recipes" |
| 101 | +/> |
| 102 | + |
| 103 | + |
| 104 | +--- |
| 105 | +<AccordionGroup> |
| 106 | + <Accordion title="Crafting point configuration template"> |
| 107 | + ```lua copy |
| 108 | + ['simple_crafting_point'] = { |
| 109 | + zone = vector3(2.0, 1.0, 2.0), |
| 110 | + label = 'Weed Processing Table', -- Label for the table |
| 111 | + model = 'v_res_tre_table2', -- Exanples: freeze_it-scripts_empty_table, freeze_it-scripts_weed_table, freeze_it-scripts_coke_table, freeze_it-scripts_meth_table |
| 112 | + restricCrafting = { |
| 113 | + ['onlyOnePlayer'] = true, -- Only one player can use the table at a time |
| 114 | + ['onlyOwnerCraft'] = false, -- Only the owner of the table can use it |
| 115 | + ['onlyOwnerRemove'] = true, -- Only the owner of the table can remove it |
| 116 | + ['jobs'] = {} |
| 117 | + }, |
| 118 | + blip = { |
| 119 | + display = true, -- Display blip on map |
| 120 | + sprite = 446, -- Select blip from (https://docs.fivem.net/docs/game-references/blips/) |
| 121 | + displayColor = 2, -- Select blip color from (https://docs.fivem.net/docs/game-references/blips/) |
| 122 | + displayText = 'Crafting Table', |
| 123 | + }, |
| 124 | + recipes = { |
| 125 | + -- Here you can add as many recipes as you want |
| 126 | + } |
| 127 | + } |
| 128 | + ``` |
| 129 | + </Accordion> |
| 130 | +</AccordionGroup> |
| 131 | + |
0 commit comments