Configuration

Config.lua Documentation

This document explains all configuration options available in config.lua and how they are used throughout the nn_storage system.


Creator Configuration

Config.Creator

Controls access to the storage creation command and UI.

Config.Creator = {
    Command = "cstorage",
    Job = "realestate",
}

Command (string)

  • Default: "cstorage"

  • Usage: Defines the chat command players use to open the storage creator UI

  • Description: Players type /cstorage (or whatever you set) to open the creator interface

Job (string)

  • Default: "realestate"

  • Usage: Restricts creator access to specific job

  • Description: Only players with this job can create storage units. Set to "nil" to allow all players

  • Special: If set to "nil" (string), bypasses job requirement


Player Configuration

Config.MaxPlayerWeight

Sets the maximum carrying capacity for players in the inventory system.

  • Type: number (kilograms)

  • Default: 100

  • Usage: Used when sending player inventory data to UI

  • Description: Maximum weight a player can carry in their inventory (displayed in kg)

Config.GetItemImage

Function that generates image URLs for inventory items.

  • Type: function

  • Parameter: itemName (string) - The item's name/identifier

  • Returns: string - Complete URL to the item's image

  • Usage: Called when building inventory data for UI display

  • Customization: Modify the base URL to point to your inventory system's image directory


Storage Configuration

Config.Storage

Main storage system configuration containing all storage-related settings.

SafeProps (table)

List of prop models that can be used for safe storage units.

  • Type: table (array of strings)

  • Usage: Provides options in the creator UI for safe prop selection

  • Description: GTA V prop models that can be used as visual representations for safes

SageOffsets (table)

Position offsets for different storage props to align interaction points properly.

  • Type: table (prop_name -> vector3)

  • Usage: Adjusts interaction point positioning relative to prop center

  • Description: Fine-tunes where players interact with storage props for better UX

ContainerProps (table)

Defines the default prop model used for container storage units.

  • Type: table

  • Usage: Auto-assigned when creating container storage

  • Description: Container storage always uses this prop model (shipping container)

Pricing (table)

Cost structure for different storage types based on capacity and features.

  • Type: table (storage_type -> pricing_config)

  • Usage: Calculates total cost during storage creation

  • Components:

    • base: Fixed base cost for the storage type

    • capacityPrice: Cost per kilogram of storage capacity

    • keyPrice: Cost per physical key generated

WeightLimits (table)

Minimum and maximum weight capacities for each storage type.

  • Type: table (storage_type -> {min, max})

  • Usage: Enforces capacity limits in creator UI

  • Description: Sets the allowable weight range for each storage type (in kg)

Placement (table)

Visual and interaction settings for the storage placement system.

  • Type: table

  • Usage: Controls visual feedback during storage placement

  • Components:

    • markerType: GTA V marker type ID (1 = downward arrow)

    • markerColor: RGBA color values for the placement marker

    • markerSize: X, Y, Z scale of the placement marker

    • interactionDistance: How close players must be to interact (in meters)

    • placementDistance: Maximum distance from player for placing storage


Item Rarity Configuration

Config.Rarity

Defines rarity levels for items, affecting their visual appearance in the inventory UI.

  • Type: table (item_name -> rarity_level)

  • Usage: Applied when building item data for UI display

  • Rarity Levels: "common", "uncommon", "rare", "epic", "legendary"

  • Default: Items not listed default to "common"

  • UI Effect: Different rarity levels display with different colors/styling in the inventory


Storage Key Configuration

Config.StorageKey

Defines the item properties for physical storage keys when using key-based access.

  • Type: table

  • Usage: Referenced when creating physical key items for storage access

  • Components:

    • item_name: Database identifier for the key item

    • label: Display name shown in inventory

    • description: Tooltip text for the item

    • weight: Item weight in kilograms (0.1kg)

    • image: Filename for the key's inventory icon

    • stackable: Whether multiple keys can stack (false for unique keys)


Configuration Usage Patterns

Price Calculation

The system uses a three-component pricing model:

  1. Base Price: Fixed cost per storage type

  2. Capacity Price: Variable cost based on weight capacity

  3. Key Price: Additional cost for each physical key

Weight Management

  • Server stores weights in grams internally

  • UI displays weights in kilograms

  • Conversion happens during data transfer (weight / 1000)

Access Control Priority

  1. Job Access: Automatic access if player job matches storage job

  2. Key Access: Requires physical key item in inventory

  3. PIN Access: Requires correct PIN code entry

  4. Public Access: No authentication required

Storage Type Differences

  • Safes: Optional props, medium capacity, higher cost per kg

  • Lockers: Multiple units per storage, no props, lowest cost per kg

  • Containers: Always use props, highest capacity, lowest cost per kg


Customization Examples

Change Storage Capacity Limits

Adjust Pricing

Change Creator Access

Custom Item Images

Last updated