⚙️Configuration

Check the instructions below.

The configuration is handled in the shared/config.lua file. Below is an explanation of the configurable options:


NPC Configuration

NPCs define where players can interact to buy and sell items.

Setting
Description
Example Value

coords

Coordinates where the NPC is placed.

vector3(-662.180, -934.961, 20.829)

heading

Orientation of the NPC.

90.0

ped

Pedestrian model for the NPC.

"s_m_m_security_01"

Example NPC Configuration

Npcs = {
  {
    coords = vector3(-662.180, -934.961, 20.829),
    heading = 90.0,
    ped = "s_m_m_security_01",
    Items = {
      ["weapon_combatpdw"] = {
        name = "weapon_combatpdw",
        label = "Combat PDW",
        category = "Guns",
        image = "https://cfx-nui-qb-inventory/html/images/weapon_combatpdw.png",
        buyPrice = 500,
        sellPrice = 150,
        amount = 0
      }
    }
  }
}

Item Configuration

Each NPC can have a list of items available for purchase or sale.

Setting
Description
Example Value

name

Internal name of the item.

"weapon_combatpdw"

label

Display name for the item.

"Combat PDW"

category

Category of the item (e.g., Guns, Ammo).

"Guns"

image

URL for the item image.

"https://cfx-nui-qb-inventory/...png"

buyPrice

Price for buying the item.

500

sellPrice

Price for selling the item.

150

amount

Stock amount (set 0 for unlimited).

0

Example Item Configuration

Items = {
  ["weapon_assaultrifle"] = {
    name = "weapon_assaultrifle",
    label = "Assault Rifle",
    category = "Weapons",
    buyPrice = 500,
    sellPrice = 250,
    image = "https://cfx-nui-qb-inventory/html/images/weapon_assaultrifle.png",
    amount = 0
  }
}

Currency Configuration

Setting
Description
Default Value

Currency

The currency symbol or string for the shop.

"$"

Example:

  • Use "$" for dollar-based currencies.

  • Use "Points" for point-based systems.

  • Use "" if no currency is needed.

Currency = "$"

Categories Configuration

Categories group items for better organization in the shop. While the current configuration has an empty Categories array, you can define categories as needed.

Example Category Configuration

Categories = {
  "Guns",
  "Ammo",
  "Armor"
}

Usage

  1. Approach an NPC to open the shop menu.

  2. Browse available items for purchase or sale.

  3. Items are displayed with their images, prices, and stock availability.


Last updated