RDE_OXITEMS DOCS
RED DRAGON ELITE // ECONOMY & GAMEPLAY

No More SSH Sessions
To Edit items.lua at 2am.

rde_oxitems replaces hand-editing ox_inventory's items.lua with a full in-game NUI panel. Create, edit, and delete items at runtime — persisted to MySQL, re-injected on every restart, and exportable as a ready-to-paste Lua block whenever you want them permanent.

01 / Start Here

Overview

Every item is stored in the rde_items MySQL table. On every server start, rde_oxitems reads that table and injects all items into ox_inventory's runtime cache via the exports.ox_inventory:Items() setter — from ox_inventory's perspective, there's no difference between items loaded from items.lua and items injected this way.

Core Principle The DB is the source of truth; ox_inventory's runtime cache is always derived from it, never the other way around.

Why this over editing items.lua by hand

Editing items.lua by handrde_oxitems
SSH / txAdmin file editorFull in-game NUI panel
Restart ox_inventory after every changeRuntime injection — changes take effect immediately
Items gone if the file is deleted/resetMySQL persistence — survives ox_inventory updates
No access controlTriple-layer admin check — ACE, ox_core groups, SteamID
02 / Start Here

Quick Start

server.cfg
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_inventory
ensure rde_oxitems   -- must start AFTER ox_inventory

The rde_items table auto-creates on first start. Open the panel with /oxitems. Click Import from OX to bootstrap the DB from your existing items.lua.

03 / Reference

How Runtime Injection Works

ox_inventory's dual-purpose Items() export
-- Getter: returns all registered items
local items = exports.ox_inventory:Items()

-- Setter: registers or updates a single item at runtime
exports.ox_inventory:Items(itemName, itemData)
What the setter cannot do Write to items.lua on disk, place images in ox_inventory/web/images/, or survive an ox_inventory restart unless rde_oxitems also restarts alongside it.
04 / Reference

Lua Export Generator

For items that need to survive a complete database wipe or server migration, the export generator produces a ready-to-paste Lua block with full syntax highlighting. The data_file approach is strongly recommended over editing items.lua directly — it keeps custom items in a separate file that survives ox_inventory updates untouched.

ox_inventory fxmanifest.lua
data_file 'data/rde_items.lua'
05 / Reference

Configuration

config.lua
Config.DatabaseTable   = 'rde_items'
Config.DefaultLanguage = 'en'   -- 'en' | 'de'

Config.AdminGroups = {
    ['admin'] = true, ['superadmin'] = true,
}
06 / Reference

Security

Every callback and net event checks IsAdmin(source) before execution
Players who fail an admin check on a mutation event are dropped, not just notified
JSON fields parsed server-side before injection — malformed JSON is rejected, not executed
Notification dedup prevents spam within a 2-second window
07 / More

Common Pitfalls

attempt to index a nil value (global 'Config')

config.lua must declare Config = {} as a true global — FiveM's shared_scripts runs files in a shared scope, and local makes the variable invisible to other files.

Fix: confirm the first line of config.lua is Config = {}, not local Config = {}.

Items created in-game vanish after restart ox_inventory

The Items() setter only affects the runtime cache — restarting ox_inventory alone wipes the injection.

Fix: restart rde_oxitems alongside ox_inventory, or use the Lua Export Generator for truly permanent items.

08 / More

FAQ

Does this replace items.lua entirely?

No — it works alongside it. Items from both sources behave identically once loaded.

What framework is the NUI built on?

RDWE-UI — the Red Dragon Web Engine UI framework. Zero Bootstrap, zero Materialize, zero jQuery.

09 / More

Changelog

v2.0.0

Full rewrite — RDWE-UI, bilingual locale system, Lua Export Generator, statebag-driven realtime sync, XSS fix in card rendering, triple-layer admin check.