Configuration

3 min readUpdated 2 weeks ago

Overview

  • shared/config.lua: Core settings, commands, editor, item definitions, bone list, theme colors

All item positions are stored per-player via KVP. No server config file.

General

shared/config.lua
1Config.Debug = false
2Config.Locale = 'en'
3Config.Theme = 'default'
4Config.WeaponComponents = true
5Config.FlashlightPersist = true
6Config.UpdateInterval = 1000
  • Debug: Console output for troubleshooting
  • Locale: Language code for translations
  • Theme: UI theme for editor gizmo and silhouette
  • WeaponComponents: Render weapon attachments (scopes, suppressors, grips) on holstered weapons
  • FlashlightPersist: Remember flashlight on/off state per weapon serial across holster/draw
  • UpdateInterval: Milliseconds between inventory sync checks

Commands

shared/config.lua
1Config.Commands = {
2    Edit = 'carryedit',
3    Reset = 'carryreset',
4    ConfigEditor = 'carryadmin',
5}
  • Edit: Open the position editor for an item (/carryedit [itemName])
  • Reset: Reset an item's position to default (/carryreset [itemName])
  • ConfigEditor: Open the admin config editor (/carryadmin, requires admin permissions)

Position Validation

shared/config.lua
1Config.MaxPositionOffset = 0.30
2Config.MinPropDistance = 0.12
  • MaxPositionOffset: Maximum allowed offset from default position per axis (meters). Prevents props being placed far from the body.
  • MinPropDistance: Minimum distance from bone center. Prevents props being hidden inside the player model.

Editor

shared/config.lua
1Config.Editor = {
2    PositionStep = 0.01,
3    RotationStep = 1.0,
4    Silhouette = { Enabled = true },
5}
  • PositionStep: Meters moved per keypress in the editor
  • RotationStep: Degrees rotated per keypress
  • Silhouette.Enabled: Show a glowing outline on the prop being edited (uses theme color)

The editor supports both a 3D gizmo (mouse drag) and keyboard controls (numpad).

Item Definitions

Each item maps an inventory item to a 3D prop with bone attachment and per-gender offsets.

shared/config.lua
1Config.Items = {
2    {
3        name = 'weapon_carbinerifle',
4        prop = 'w_ar_carbinerifle',
5        bone = 24818,
6        isWeapon = true,
7        defaultPosition = {
8            male = {
9                x = -0.02, y = -0.14, z = 0.13,
10                rx = 0.0, ry = 2.5, rz = 5.0,
11            },
12            female = {
13                x = 0.08, y = -0.14, z = 0.12,
14                rx = 0.0, ry = 0.0, rz = 0.0,
15            },
16        },
17    },
18}
  • name: Inventory item name (case-insensitive match)
  • prop: GTA prop or weapon model name
  • bone: GTA ped bone hash for attachment (see Config.BoneList)
  • isWeapon: true = use weapon asset loader (supports components/tints), false = use standard prop
  • defaultPosition: Separate offsets for male and female peds. x/y/z = position, rx/ry/rz = rotation in degrees

Players can customize these positions per-item using /carryedit. Custom positions are stored server-side in KVP.

Admin Config Editor

Use /carryadmin to add new items, pick bones and set positions from in-game. Saves go to the database and apply to every connected player live, no restart.