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.
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.
Why this over editing items.lua by hand
| Editing items.lua by hand | rde_oxitems |
|---|---|
| SSH / txAdmin file editor | Full in-game NUI panel |
| Restart ox_inventory after every change | Runtime injection — changes take effect immediately |
| Items gone if the file is deleted/reset | MySQL persistence — survives ox_inventory updates |
| No access control | Triple-layer admin check — ACE, ox_core groups, SteamID |
Quick Start
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.
How Runtime Injection Works
-- 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)
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.
data_file 'data/rde_items.lua'
Configuration
Config.DatabaseTable = 'rde_items'
Config.DefaultLanguage = 'en' -- 'en' | 'de'
Config.AdminGroups = {
['admin'] = true, ['superadmin'] = true,
}
Security
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.
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.
Changelog
Full rewrite — RDWE-UI, bilingual locale system, Lua Export Generator, statebag-driven realtime sync, XSS fix in card rendering, triple-layer admin check.