### HeidiSQL Connection Setup
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/before-you-start/how-to-install-heidisql.mdx
Details on configuring a new database connection within the HeidiSQL application, specifying network type, hostname, user credentials, and port.
```APIDOC
HeidiSQL Connection Configuration:
When creating a new connection in HeidiSQL:
- **Network Type**: Select 'MySQL (TCP/IP)' for standard MariaDB/MySQL connections.
- **Hostname/IP**: Enter the address of your database server. Common values include 'localhost' for a local installation or a specific IP address.
- **User**: Specify the database username. Typically 'root' for initial setups.
- **Password**: Input the password for the specified database user, set during the database installation.
- **Port**: Enter the port number the database server is listening on. The default for MariaDB/MySQL is '3306'.
After filling in the details, click 'Save' to store the connection profile and 'Open' to establish the connection.
```
--------------------------------
### Start Development Server
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/README.md
Starts the local development server. Visit localhost:3000 to view the project.
```bash
pnpm dev
```
--------------------------------
### Configure server.cfg for it_bridge
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/installation.mdx
This example demonstrates the correct order for adding the it_bridge resource and its dependencies to your FiveM server.cfg file. It emphasizes placing core framework, inventory, and essential libraries like ox_lib before the it_bridge script itself to ensure proper functionality.
```lua
-- First we will start the Database
ensure oxmysql
-- Then we will start the cores, never below
ensure es_extended or qb-core
-- Your inventory system, always on top
ensure inventory
--Then we start all the dependencies
ensure ox_lib
-- Then you need to start all system you selected in the config file
-- Now you can start the it_bridge script
ensure it_bridge
-- After that you can start any other it script you want to use
```
--------------------------------
### Server.cfg Script Ordering for IT Scripts
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Ensures proper execution order for IT Scripts and their dependencies within the server.cfg file. It's crucial to start databases and core libraries before the main scripts for seamless integration.
```lua
-- First we will start the Database
ensure oxmysql
ensure framework -- Your framework, always on top [This has to be an actual script name]
ensure inventory -- Your inventory system, [This has to be an actual script name]
ensure ox_lib -- The library for the script
ensure [other-dependencies] -- Other dependencies that you may have and need for it_bridge
ensure it_bridge -- The bridge for all it-scripts
ensure it-drugs
```
--------------------------------
### Install Dependencies
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/README.md
Installs project dependencies using pnpm. This is a prerequisite for running the development server.
```bash
pnpm i
```
--------------------------------
### Lua: Recipe Configuration Template
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/adjustments/recipes.mdx
Provides a comprehensive template for defining new recipes in Lua. This example includes all configurable fields and serves as a starting point for custom recipe creation.
```lua
['your_uniqe_id'] = {
label = 'Your Label',
ingrediants = {
-- Here you can add as many ingredients as you want
},
outputs = {
-- Here you can add as many outputs as you want
},
processTime = 15,
failChance = 15,
showIngrediants = true,
animation = {
dict = 'anim@amb@drug_processors@coke@female_a@idles',
anim = 'idle_a'
},
skillCheck = {
enabled = false,
difficulty = {'easy', 'easy', 'medium', 'easy'},
keys = {'w', 'a', 's', 'd'}
}
}
```
--------------------------------
### Start it_bridge Script
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/test.mdx
Manually starts the it_bridge script via the txAdmin Console. This command is used if the script does not start automatically upon server startup.
```lua
start it_bridge
```
--------------------------------
### SQL Database Cleanup for it-crafting
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/installation.mdx
SQL command to drop the `it_crafting_tables` if it already exists. This is a preparatory step before initial script setup or updates to ensure a clean slate.
```sql
-- Check for the it_crafting_tables table
DROP TABLE IF EXISTS `it_crafting_tables`;
```
--------------------------------
### Example Item Requirement Configuration
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/tipps-and-tricks/additional-plant-settings.mdx
An example demonstrating how to configure a specific item, like a 'watering_can', within the 'reqItems' structure. It specifies the quantity needed and whether it's removed after use.
```lua
['watering_can'] = {amount = 1, remove = true},
```
--------------------------------
### Full Plant Configuration Example with Required Items
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/tipps-and-tricks/additional-plant-settings.mdx
This comprehensive example illustrates a complete plant configuration, including custom growth times, product ranges, seed return chances, and detailed 'reqItems' for both planting and harvesting phases.
```lua
['weed_lemonhaze_seed'] = {
label = 'Lemon Haze', -- Label for the plant
plantType = 'plant1', -- Choose plant types from (plant1, plant2, small_plant)
growthTime = 2, -- Cutsom growth time in minutes false if you want to use the global growth time
onlyZone = false, -- Set to zone id if you want to plant this seed only in a specific zone
zones = {'weed_zone_one', 'weed_zone_two'}, -- Zones where the seed can be planted
products = { -- Item the plant is going to produce when harvested with the max amount
['weed_lemonhaze'] = {min = 1, max = 4}
--['other_item'] = {min = 1, max = 2}
},
seed = {
chance = 50, -- Percent of getting back the seed
min = 1, -- Min amount of seeds
max = 2 -- Max amount of seeds
},
time = 3000, -- Time it takes to plant/harvest in miliseconds
reqItems = { -- Items required to plant the seed
["planting"] = {
['watering_can'] = {amount = 1, remove = true},
['shovel'] = {amount = 1, remove = false},
},
["harvesting"] = {
['watering_can'] = {amount = 1, remove = true},
['shovel'] = {amount = 1, remove = false}
}
}
},
```
--------------------------------
### Example: Open Menu with Options
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/exports/menus/client.mdx
Demonstrates how to use the `exports.it_bridge:OpenMenu` function with sample menu data. This example includes multiple options, some with specific parameters like events and arguments, and one disabled option.
```lua
exports.it_bridge:OpenMenu({
id = 'example',
title = 'Example Menu',
options = {
{
title = 'Option 1',
description = 'This is option 1',
onSelect = function()
print('Option 1 selected')
end,
params = {
event = 'example:event',
args = { 'arg1', 'arg2' },
},
},
{
title = 'Option 2',
description = 'This is option 2',
onSelect = function()
print('Option 2 selected')
end,
params = {
event = 'example:event',
args = { 'arg1', 'arg2' },
},
},
{
title = 'Disabled Button',
description = 'This button is disabled',
icon = 'fas fa-ban',
disabled = true,
}
},
})
```
--------------------------------
### SQL Database Table Creation for it-crafting
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/installation.mdx
SQL command to create the `it_crafting_tables` table with specified columns. This is used for manual database installation or when the script doesn't auto-create it, ensuring the necessary structure for the crafting system.
```sql
-- Install the it_crafting_tables table
CREATE TABLE IF NOT EXISTS it_crafting_tables (
id VARCHAR(11) NOT NULL,
PRIMARY KEY(id),
coords LONGTEXT NOT NULL,
rotation DOUBLE NOT NULL,
owner LONGTEXT NOT NULL,
type VARCHAR(100) NOT NULL
);
```
--------------------------------
### Lua: Crafting Table Configuration Example
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/adjustments/crafting-tables.mdx
Provides a comprehensive example of a Lua configuration table for a 'simple_crafting_table'. It includes settings for the table's zone, label, model, crafting restrictions (player limits, ownership), blip display, and recipe definitions.
```lua
["simple_crafting_table"] = {
zone = vector3(2.0, 1.0, 2.0),
label = 'Weed Processing Table', -- Label for the table
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
restricCrafting = {
['onlyOnePlayer'] = true, -- Only one player can use the table at a time
['onlyOwnerCraft'] = false, -- Only the owner of the table can use it
['onlyOwnerRemove'] = true, -- Only the owner of the table can remove it
['zones'] = {}, -- Zones where the table can be used
['jobs'] = {}
},
blip = {
display = true, -- Display blip on map
sprite = 446, -- Select blip from (https://docs.fivem.net/docs/game-references/blips/)
displayColor = 2, -- Select blip color from (https://docs.fivem.net/docs/game-references/blips/)
displayText = 'Crafting Table',
},
recipes = {
-- Here you can add as many recipes as you want
}
}
```
--------------------------------
### Full Item Example with Multiple Item Rewards (Lua)
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/tipps-and-tricks/additional-sell-settings.mdx
Provides a complete item definition example with multiple item rewards. This illustrates how to set up rewards for items like 'joint', specifying various items and their quantities.
```lua
['joint'] = {
price = math.random(50, 100),
moneyType = 'bank',
rewardItems = {{name = 'paper', amount = 1}, {name = 'weed_lemonhaze', amount = 1}}
}
```
--------------------------------
### Manual Database Installation for Drug Plants and Processing
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Provides SQL commands to manually create the 'drug_plants' and 'drug_processing' tables. This is an alternative to automatic installation and requires a MariaDB-compatible database client like HeidiSQL.
```sql
DROP TABLE IF EXISTS drug_plants;
-- Install the drug_plants table
CREATE TABLE IF NOT EXISTS drug_plants (
id VARCHAR(11) NOT NULL, PRIMARY KEY(id),
owner LONGTEXT DEFAULT NULL,
coords LONGTEXT NOT NULL,
dimension INT(11) DEFAULT 0,
time INT(255) NOT NULL,
type VARCHAR(100) NOT NULL,
health DOUBLE NOT NULL DEFAULT 100,
fertilizer DOUBLE NOT NULL DEFAULT 0,
water DOUBLE NOT NULL DEFAULT 0,
growtime INT(11) NOT NULL
);
DROP TABLE IF EXISTS drug_processing;
-- Install the drug_processing table
CREATE TABLE IF NOT EXISTS drug_processing (
id VARCHAR(11) NOT NULL, PRIMARY KEY(id),
coords LONGTEXT NOT NULL,
dimension INT(11) DEFAULT 0,
rotation DOUBLE NOT NULL,
owner LONGTEXT NOT NULL,
type VARCHAR(100) NOT NULL
);
```
--------------------------------
### Start bridge_tester Script
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/test.mdx
Manually starts the bridge_tester script via the txAdmin Console. This script is used to test the functionality of the it_bridge script.
```lua
start bridge_tester
```
--------------------------------
### Lua Webhook Configuration
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/tipps-and-tricks/webhook-setup.mdx
Defines the configuration table for webhook settings in Lua. This includes enabling/disabling webhooks, setting a name and avatar, and specifying URLs for various actions like 'plant', 'table', 'sell', and 'message'. The example shows both an inactive state and an active state with a URL for plant actions.
```lua
local webhookSettings = {
['active'] = false, -- Set to true to enable the webhook
['name'] = 'it-drugs', -- Name for the webhook
['avatar'] = 'https://i.imgur.com/KvZZn88.png', -- Avatar for the webhook
['urls'] = {
['plant'] = nil, --'', -- Webhook URL for plant actions
['table'] = nil, --'', -- Webhook URL for table actions
['sell'] = nil, --'', -- Webhook URL for sell actions
['message'] = nil, --'', -- Webhook URL for messages
}
}
```
```lua
local webhookSettings = {
['active'] = true, -- Set to true to enable the webhook
['name'] = 'it-drugs', -- Name for the webhook
['avatar'] = 'https://i.imgur.com/KvZZn88.png', -- Avatar for the webhook
['urls'] = {
['plant'] = 'https://discord.com/api/webhooks/**************/*************************', -- Webhook URL for plant actions
['table'] = nil, --'', -- Webhook URL for table actions
['sell'] = nil, --'', -- Webhook URL for sell actions
['message'] = nil, --'', -- Webhook URL for messages
}
}
```
--------------------------------
### Execute FiveM Chat Command
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/configure-your-script/how-to-execute-commands.mdx
Demonstrates how to send a message to the chat using the ExecuteCommand function in FiveM. This is a basic example of programmatic command execution.
```lua
ExecuteCommand("say Hello, world!")
```
--------------------------------
### Lua Item Definitions for qb-inventory
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/installation.mdx
Lua configuration for defining items within the qb-inventory system. Each item is an object with properties such as name, label, weight, type, image, and usability.
```lua
scrapmetal = {
name = "scrapmetal",
label = 'Scrap Metal',
weight = 500,
type = 'item',
image = "scrapmetal.png",
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'Scrap Metal'
},
lockpick = {
name = "lockpick",
label = 'Lockpick',
weight = 100,
type = 'item',
image = "lockpick.png",
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'A tool for picking locks'
},
cloth = {
name = "cloth",
label = 'Cloth',
weight = 200,
type = 'item',
image = "cloth.png",
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'A piece of cloth'
},
scissors = {
name = "scissors",
label = 'Scissors',
weight = 250,
type = 'item',
image = "scissors.png",
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'A tool for cutting'
},
bandage = {
name = "bandage",
label = 'Bandage',
weight = 50,
type = 'item',
image = "bandage.png",
unique = false,
useable = false,
shouldClose = false,
combinable = nil,
description = 'A bandage for wounds'
},
simple_crafting_table = {
name = "simple_crafting_table",
label = 'Simple Crafting Table',
weight = 2000,
type = 'item',
image = "simple_crafting_table.png",
unique = true,
useable = false,
shouldClose = true,
combinable = nil,
description = 'A simple crafting table'
}
```
--------------------------------
### Lua Item Definitions for qs-inventory
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/installation.mdx
Lua configuration for defining items in the qs-inventory system. This structure includes item name, label, type, weight, uniqueness, and image path.
```lua
["scrapmetal"] = {
name = "scrapmetal",
label = "Scrap Metal",
type = "item",
weight = 500,
unique = false,
shouldClose = false,
description = "Scrap Metal",
image = "scrapmetal.png",
},
["lockpick"] = {
name = "lockpick",
label = "Lockpick",
type = "item",
weight = 100,
unique = false,
shouldClose = false,
description = "A tool for picking locks",
image = "lockpick.png",
},
["cloth"] = {
name = "cloth",
label = "Cloth",
type = "item",
weight = 200,
unique = false,
shouldClose = false,
description = "A piece of cloth",
image = "cloth.png",
}
```
--------------------------------
### Dependency: ox_lib
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Specifies the ox_lib dependency, recommending the CommunityOx fork. It provides links to its GitHub releases page and indicates the minimal and recommended versions.
```jsx
### ox_lib
}
manualTitle="Releases · CommunityOx/ox_lib"
manualDescript="Version: Minimal: 3.25.0 Recommended: latest"
>
```
--------------------------------
### Optional Dependency: qb-target (QbCore)
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Lists qb-target as an optional dependency specifically for QbCore framework. It provides a link to its GitHub releases page and specifies the minimal and recommended versions.
```jsx
### Optional for QbCore
}
manualTitle="Releases · qbcore-framework/qb-target"
manualDescript="Version: Minimal: latest Recommended: latest"
>
```
--------------------------------
### Dependency: oxmysql
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Specifies the oxmysql dependency, recommending the CommunityOx fork. It provides links to its GitHub releases page and indicates the recommended version.
```jsx
### oxmysql
}
manualTitle="Releases · CommunityOx/oxmysql"
manualDescript="Version: latest"
>
```
--------------------------------
### Import Nextra Steps Component
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/configure-your-script/how-to-anaging-translations.mdx
Imports the `Steps` component from the `nextra/components` library, commonly used for creating step-by-step guides in Next.js applications.
```javascript
import { Steps } from 'nextra/components'
```
--------------------------------
### GitHub and Releases Links
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Provides links to the project's GitHub repository for downloading the asset and accessing specific releases. These links are presented using custom Card components for a user-friendly interface.
```jsx
} title="GitHub" href="https://github.com/it-scripts/it-drugs" />
} title="Releases" href="https://github.com/it-scripts/it-drugs/releases" />
```
--------------------------------
### Define Game Items (Lua) - Additional Items
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Provides additional examples of game item definitions for inventory systems, including tools and consumables. These are often integrated into frameworks like ESX or QBCore for inventory management.
```lua
["watering_can"] = {
name = "watering_can",
label = "Watering can",
type = "item",
weight = 500,
unique = false,
shouldClose = false,
description = "Simple watering can",
image = "watering_can.png",
},
["fertilizer"] = {
name = "fertilizer",
label = "Fertilizer",
type = "item",
weight = 500,
unique = false,
shouldClose = false,
description = "Fertilizer",
image = "fertilizer.png",
},
["advanced_fertilizer"] = {
name = "advanced_fertilizer",
label = "Advanced fertilizer",
type = "item",
weight = 500,
unique = false,
shouldClose = false,
description = "Fertilizer with the litte extra",
image = "advanced_fertilizer.png",
},
["liquid_fertilizer"] = {
name = "liquid_fertilizer",
label = "Liquid Fertilizer",
type = "item",
weight = 200,
unique = false,
shouldClose = false,
description = "Basicly Water with nutrations",
image = "liquid_fertilizer.png",
},
["weed_lemonhaze_seed"] = {
name = "weed_lemonhaze_seed",
label = "Weed Lemonhaze Seed",
type = "item",
weight = 20,
unique = false,
shouldClose = true,
useable = true,
description = "Weed Lemonhaze Seed",
image = "weed_lemonhaze_seed.png",
},
["weed_lemonhaze"] = {
name = "weed_lemonhaze",
label = "Weed Lemonhaze",
type = "item",
weight = 20,
```
--------------------------------
### Register and Execute FiveM Command
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/configure-your-script/how-to-execute-commands.mdx
Illustrates how to register a new command, '/healMe', which then uses ExecuteCommand to heal the player running it. This demonstrates creating custom command shortcuts.
```lua
RegisterCommand("healMe", function()
ExecuteCommand("heal " .. GetPlayerServerId(PlayerId()))
end, false)
```
--------------------------------
### Dependency: it_bridge
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Specifies the it_bridge dependency, providing links to its Tebex store page for purchase and its documentation for installation. It indicates the minimal and recommended versions.
```jsx
### it_bridge
}
manualTitle="it_bridge - Tebex Store"
manualDescript="Version: Minimal: 1.0.1 Recommended: latest"
>
```
--------------------------------
### Full Item Example with Single Item Reward (Lua)
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/tipps-and-tricks/additional-sell-settings.mdx
Demonstrates a complete item definition in the it-drugs script, including price, money type, and a single item reward. This shows how to integrate the `rewardItems` configuration.
```lua
['joint'] = {
price = math.random(50, 100),
moneyType = 'bank',
rewardItems = {{name = 'paper', amount = 1}}
}
```
--------------------------------
### Lua Zone Configuration Example
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/adjustments/selling.mdx
Example Lua configuration for a selling zone, defining its boundaries, thickness, and the drugs that can be sold within it, including price and payment type. This structure is used to set up specific areas where players can interact with NPCs to sell items.
```lua
['groove'] = {
points = {
vec3(-154.0, -1778.0, 30.0),
vec3(48.0, -1690.0, 30.0),
vec3(250.0, -1860.0, 30.0),
vec3(142.0, -1993.0, 30.0),
vec3(130.0, -2029.0, 30.0),
},
thickness = 27,
drugs = {
['cocaine'] = {price = math.random(100, 200), moneyType = 'cash'},
['joint'] = {price = math.random(50, 100), moneyType = 'bank'},
['weed_lemonhaze'] = {price = math.random(50, 100), moneyType = 'black_money'}
}
},
```
--------------------------------
### Config Preview Component Usage
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/config-preview.mdx
Demonstrates how to use the `ConfigPreview` React component to display the configuration of the it-crafting script. It requires owner, repo, path, and branch as props to fetch and render the configuration file.
```jsx
```
--------------------------------
### Example: Sending a Robbery Dispatch
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/exports/disptach/client.mdx
Demonstrates how to use the SendDispatch function with a detailed dispatch data table. This example sends a 'Robbery' dispatch to the 'police' job, including location, call code, flashing map indicators, an image, and specific blip properties.
```javascript
exports.it_bridge:SendDispatch({
job = 'police',
title = 'Robbery',
message = 'A robbery has been reported at the bank.',
coords = {x = 0.0, y = 0.0, z = 0.0},
callCode = {
code = '10-31',
snippet = '10-31'
},
flashes = true,
image = 'https://i.imgur.com/0J2QX1E.png',
blip = {
sprite = 1,
colour = 1,
scale = 1.0,
text = 'Robbery',
time = 30000,
flashes = true
}
})
```
--------------------------------
### Example Usage of SendDispatch
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/exports/disptach/server.mdx
Demonstrates a practical example of calling the SendDispatch function with a complete dispatch data object. This includes setting job targeting, dispatch title and message, coordinates, call code, map flashing, an image URL, and detailed blip properties.
```Lua
exports.it_bridge:SendDispatch({
job = 'police',
title = 'Robbery',
message = 'A robbery has been reported at the bank.',
coords = {x = 123.45, y = 678.90, z = 42.0},
callCode = {
code = '10-31',
snippet = '10-31'
},
flashes = true,
image = 'https://i.imgur.com/0J2QX1E.png',
blip = {
sprite = 1,
colour = 1,
scale = 1.0,
text = 'Robbery',
time = 30000,
flashes = true
}
})
```
--------------------------------
### Enable OneSync in server.cfg
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/before-you-start/how-to-enable-onesync.mdx
Add the `onesync on` command to your `server.cfg` file to enable the OneSync feature in FiveM. This is the primary step for enabling the synchronization feature.
```plaintext
onesync on
```
--------------------------------
### React App Component Setup
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/_app.mdx
This snippet defines the root React component for the application. It serves as a wrapper that renders the current page component and its props, facilitating client-side routing and application structure.
```javascript
import '../style.css';
export default function App({ Component, pageProps }) {
return ;
}
```
--------------------------------
### Lua: Seed Dealer Configuration Example
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/adjustments/dealers.mdx
Provides a detailed example of a Lua configuration table for a 'seed_dealer'. This includes defining the dealer's ID, display label, spawn locations, ped model, blip properties, and the items they buy and sell with associated pricing and money types.
```lua
['seed_dealer'] = { -- Dealer id (Musst be unique)
label = 'Seed Dealer', -- Dealer name
locations = { -- Dealer will spawn at one of these locations
vector4(-462.8489, 1101.5592, 326.6819, 166.9773),
vector4(-49.4244, 1903.6714, 194.3613, 95.7213),
vector4(2414.2463, 5003.8462, 45.6655, 40.8932),
},
ped = 's_m_y_dealer_01', -- Ped model
blip = {
display = false, -- Display blip on map
sprite = 140, -- Select blip from (https://docs.fivem.net/docs/game-references/blips/)
displayColor = 2, -- Select blip color from (https://docs.fivem.net/docs/game-references/blips/)
displayText = 'Seed Dealer',
},
items = {
['buying'] = { -- Items the dealer buys from you
['weed_lemonhaze'] = {min = 100, max = 200, moneyType = 'black_money'}, -- min/max price
},
['selling'] = { -- Items the dealer sells to you
['weed_lemonhaze_seed'] = {min = 100, max = 200, moneyType = 'black_money'}, -- min/max price
['coca_seed'] = {min = 100, max = 300, moneyType = 'black_money'},
},
},
},
```
--------------------------------
### Lua Item Definitions for ox_inventory
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-crafting/installation.mdx
Lua configuration for defining items within the ox_inventory system. This format includes properties like label, weight, stackability, close behavior, description, and client-side image paths.
```lua
["scrapmetal"] = {
label = "Scrap Metal",
weight = 500,
stack = true,
close = false,
description = "Scrap Metal",
client = {
image = "scrapmetal.png",
}
},
["lockpick"] = {
label = "Lockpick",
weight = 100,
stack = true,
close = false,
description = "A tool for picking locks",
client = {
image = "lockpick.png",
}
},
["cloth"] = {
label = "Cloth",
weight = 200,
stack = true,
close = false,
description = "A piece of cloth",
client = {
image = "cloth.png",
}
},
["scissors"] = {
label = "Scissors",
weight = 250,
stack = true,
close = false,
description = "A tool for cutting",
client = {
image = "scissors.png",
}
},
["bandage"] = {
label = "Bandage",
weight = 50,
stack = true,
close = false,
description = "A bandage for wounds",
client = {
image = "bandage.png",
}
},
["simple_crafting_table"] = {
label = "Simple Crafting Table",
weight = 2000,
stack = false,
close = false,
description = "A simple crafting table",
client = {
image = "simple_crafting_table.png",
},
server = {
export = "it-crafting.placeCraftingTable"
}
}
```
--------------------------------
### Configuration Options (Lua)
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/adjustments/processing-tables.mdx
Illustrates key configuration parameters for processing tables and recipes, including enabling processing, skill check activation, processing time, and failure chance.
```lua
-- Enable processing globally
Config.EnableProcessing = true
-- Activate skill check for crafting
Config.ProccesingSkillCheck = true
-- Customize skill check behavior (details elsewhere)
Config.SkillCheck = {}
-- Recipe specific configurations
-- processTime: Time in seconds if skill check is disabled
processTime = 5
-- failChance: Percentage chance of crafting failure
failChance = 15
```
--------------------------------
### Error Callout Example
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it_bridge/exports/interaction/server.mdx
Demonstrates how to use the Callout component to display an error message. This snippet highlights a common pattern for user feedback within documentation or application interfaces.
```javascript
import { Callout } from '@components/Callout'
// ...
The Interactions has no server exports available. If you want to use the Interactions exports please use the client exports.
```
--------------------------------
### Item Configurations
Source: https://github.com/it-scripts/it-scripts.github.io/blob/main/pages/it-drugs/installation.mdx
Defines various in-game items with their properties such as name, label, weight, type, and usage flags. This data structure is used to manage game assets and their attributes.
```Lua
["coca"] = {
["name"] = "coca",
["label"] = "Coca",
["weight"] = 100,
["type"] = "item",
["image"] = "coca.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Coca"
},
["paper"] = {
["name"] = "paper",
["label"] = "Paper",
["weight"] = 100,
["type"] = "item",
["image"] = "paper.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Use to roll some good stuff"
},
["nitrous"] = {
["name"] = "nitrous",
["label"] = "Nitrous",
["weight"] = 100,
["type"] = "item",
["image"] = "nitrous.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Nitrous"
},
["cocaine"] = {
["name"] = "cocaine",
["label"] = "Cocaine",
["weight"] = 100,
["type"] = "item",
["image"] = "cocaine.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Small bag of cocaine"
},
["joint"] = {
["name"] = "joint",
["label"] = "Joint",
["weight"] = 100,
["type"] = "item",
["image"] = "joint.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "High on life"
},
["weed_processing_table"] = {
["name"] = "weed_processing_table",
["label"] = "Weed Processing Table",
["weight"] = 100,
["type"] = "item",
["image"] = "weed_processing_table.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Process some weed"
},
["cocaine_processing_table"] = {
["name"] = "cocaine_processing_table",
["label"] = "Cocaine Processing Table",
["weight"] = 100,
["type"] = "item",
["image"] = "cocaine_processing_table.png",
["unique"] = false,
["useable"] = false,
["shouldClose"] = true,
["combinable"] = nil,
["description"] = "Process some cocaine"
}
```