For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

The ak47_inventory resource is highly configurable through the files located in the configs/ directory. This guide explains the purpose of each configuration file and key settings you can adjust.

config.lua

This is the core configuration file for the inventory. It contains general settings, shared item definitions, and framework settings.

Key Settings

  • Framework & SQL: Automatically detects ESX or QBCore. You can explicitly set it if needed.

  • Player Inventory Limits:

    • Config.PlayerInvWeight: Default max weight (e.g., 120000).

    • Config.PlayerInvSlots: Default max slots (e.g., 50).

  • Default Stash Size:

    • Config.DefaultStashWeight and Config.DefaultStashSlots define the capacity for newly created stashes.

  • Shared Items List: The Config.Shared.Items table defines every item in the game, including their labels, weights, stack sizes, and types (e.g., 'weapon', 'item', 'ammo').

  • Drop Settings: Configure how long items stay on the ground (Config.ClearDropInterval) and the max capacity of a single drop pile.

config-weapon.lua

This file controls all weapon-related mechanics in the inventory.

Key Settings

  • Spawn With Ammo: Define how much ammo a weapon gets when it is spawned or purchased.

  • Weapon Attachments: The Config.Shared.Components table maps attachment items to their respective weapon hashes.

  • Repair Mechanics:

    • Config.RepairWeaponWithItem defines which items are required to repair specific weapons (e.g., repairing an AP Pistol might require 5x scrap metal and 1x weapon repair kit).

config-clothing.lua

This file governs how clothing items (like masks, helmets, or glasses) function as physical items in the inventory.

Key Settings

  • Clothing Types: Defines which items count as clothing.

  • Skin Data Mapping: Ensures that when a player equips a clothing item, their character model's drawable/texture IDs are updated correctly.

config-backpack.lua

This file handles the backpack system, allowing players to carry additional storage.

Key Settings

  • Backpack Items: Defines which items function as backpacks.

  • Capacity: Sets the slots and maxWeight provided by each specific backpack item.

  • Blacklists/Whitelists: You can prevent certain items from being put into backpacks (e.g., preventing a player from putting a backpack inside another backpack).

config-vehicle.lua

This file manages trunk and glovebox capacities for vehicles.

Key Settings

  • Class-Based Capacity: Defines default slots and max weight based on the vehicle's class (e.g., Compacts, SUVs, Vans, Commercial).

  • Model-Based Override: Allows you to override the capacity for specific vehicle spawn codes (e.g., giving a specific custom truck a massive trunk).

shared/ Directory Configurations

Unlike traditional single-file configurations, ak47_inventory uses a modular shared/ directory to define all game items and objects. This ensures clean, organized data management.

  • items.lua: Defines standard inventory items, including labels, weight, type, and decay/durability properties.

  • weapons.lua: Defines weapon items, their associated ammo types (ammoname), durability degradation rates, and whether they are throwable.

  • ammo.lua: Defines all ammo types (e.g., ammo-9, ammo-rifle) and their weights.

  • components.lua: Defines weapon attachments (suppressors, scopes) and maps them to client component hashes.

  • shops.lua / vending.lua: Configures shop locations, available stock, prices, required jobs/licenses, and currency types.

  • crafting.lua: Defines crafting benches, their recipes, required ingredients, and crafting duration.

  • stash.lua / dumpsters.lua: Pre-configures static map stashes and dumpster interactions.

webhooks.lua

Found in the root directory, this file handles Discord integration. You can supply your Discord Webhook URLs here to automatically log vital inventory events to your server's Discord:

  • additem & removeitem: Logs when items are spawned or deleted.

  • swapitem: Logs when items are moved between slots.

  • transfer: Logs when items are moved from one inventory to another (e.g., player to stash, player to player).

locales/ Directory

The resource is fully translatable. Inside the locales/ folder, you will find language files (e.g., en.lua). You can modify all UI text, notification strings, and prompt labels here. Ensure your config.lua is set to point to your desired locale file.

Last updated