FreeVehicle
sd-itemspawner
by Samuels-Development · version 2026.09.12 · updated 3 days ago
No reviews yet
- Downloads
- 0
- Reviews
- 0
- Size
- 93 KB
- Code check
- Clean
- Licence
- GPL-3.0
- Released
- Nov 2026
Admin item spawner for ox_inventory: every registered item in a searchable grid, per-item quantities, metadata editor, saved loadouts, and delivery to yourself,
sd-itemspawner
An admin item spawner for ox_inventory.
Every registered item in one searchable grid — weapons, ammo, attachments and all — with per-item
quantities, a metadata editor, saved loadouts, and delivery to yourself, one player, everyone
nearby or the whole server. One command in, everything else server-validated.
If sd-itemspawner is useful to you, please ⭐ the repo. Issues and pull requests are always welcome.
Store · Documentation · Discord
A spawner that shows you everything ox_inventory actually has registered — not a hand-written
list you have to keep in sync. The catalog is read from
includes
Add an item to
Catalog, Every registered item, auto-categorised into weapons / ammo / attachments / usable / misc. Icons resolve from ox_inventory's own image folder — nothing is copied or duplicated.
Search, Multi-term and ranked. Typing
Quantities, Per item, not one global amount. Stage
Metadata, Free-form key/value editor per item, with the value type inferred and shown as a badge. Leave it empty and ox_inventory generates its own serials and durability.
Loadouts, Save a selection by name, re-spawn it in one click, or load it back into the tray to edit first. Stored per admin in a flat JSON file — no database table.
Targets, Yourself, a specific player, everyone within a radius, or every connected player.
Feedback, Partial success is reported as partial success: "delivered 4, 1 failed — Riley Bennett: Gold Bar (no room)", not a silent failure.
Security
The whole design assumes an attacker can call any server callback with any payload, because they
can. Nothing is protected by being hard to find.
Getting in.
server-side dispatcher checks the
is the only writer of the in-memory session table.
Staying in. Every privileged callback then runs four checks, cheapest first:
Check, Rejects
A session exists, Anyone who never ran the command
The ACE still holds, re-tested per call, An admin whose permission was pulled mid-session
The identifier still matches, Server-ID reuse — a player disconnecting and the next joiner inheriting their slot and their session
The session is inside its TTL, A panel left open and walked away from
What gets trusted. Nothing the client says about an item. It sends a bare item key; the server
resolves it against its own catalog and reads the label, weight and stack from there. Unknown keys,
blacklisted items, non-integer counts, counts over the cap, oversized or too-deeply-nested metadata,
and offline targets are all rejected before anything reaches
rejected rather than clamped, so a malformed request is visible instead of silently shrunk.
There is one
applies the gate — so no endpoint can be added later that forgets it. There are no server-side
acting admin's name, licence, items and recipients.
How it works
The item catalog is never sent over the network. ox_inventory maintains a registry on both
sides, so the client builds the grid from its own copy while the server keeps an independent one
purely as the validation authority. Opening the panel costs one small round trip for presets and
the player list, not a 500-item payload.
The grid is row-windowed, so a 500-item catalog mounts about thirty cards at a time instead of
firing 500 image requests on open.
Files
InstallationDependencies
Resource, What it
…
An admin item spawner for ox_inventory.
Every registered item in one searchable grid — weapons, ammo, attachments and all — with per-item
quantities, a metadata editor, saved loadouts, and delivery to yourself, one player, everyone
nearby or the whole server. One command in, everything else server-validated.
If sd-itemspawner is useful to you, please ⭐ the repo. Issues and pull requests are always welcome.
Store · Documentation · Discord
IMPORTANTWhat it is
sd-itemspawner is ox_inventory-only, by design.
There is no inventory bridge and no framework detection. It callsox_inventory's exports
directly and resolves players through natives, which is why it needs no framework, no database
and no SQL file. If you run any other inventory, this resource is not for you.
A spawner that shows you everything ox_inventory actually has registered — not a hand-written
list you have to keep in sync. The catalog is read from
ox_inventory:Items() at runtime, so itincludes
data/items.lua, data/weapons.lua, and anything another resource registered on boot.Add an item to
items.lua and it is in the grid on the next restart with no edits here.Catalog, Every registered item, auto-categorised into weapons / ammo / attachments / usable / misc. Icons resolve from ox_inventory's own image folder — nothing is copied or duplicated.
Search, Multi-term and ranked. Typing
pistol puts WEAPON_PISTOL first instead of burying it under thirty attachments that merely contain the word.Quantities, Per item, not one global amount. Stage
5x bandage and 1x pistol in the same spawn.Metadata, Free-form key/value editor per item, with the value type inferred and shown as a badge. Leave it empty and ox_inventory generates its own serials and durability.
Loadouts, Save a selection by name, re-spawn it in one click, or load it back into the tray to edit first. Stored per admin in a flat JSON file — no database table.
Targets, Yourself, a specific player, everyone within a radius, or every connected player.
Feedback, Partial success is reported as partial success: "delivered 4, 1 failed — Riley Bennett: Gold Bar (no room)", not a silent failure.
Security
The whole design assumes an attacker can call any server callback with any payload, because they
can. Nothing is protected by being hard to find.
Getting in.
lib.addCommand registers /itemspawner as a restricted command, so FiveM's ownserver-side dispatcher checks the
command.itemspawner ACE before the handler runs. That handleris the only writer of the in-memory session table.
Staying in. Every privileged callback then runs four checks, cheapest first:
Check, Rejects
A session exists, Anyone who never ran the command
The ACE still holds, re-tested per call, An admin whose permission was pulled mid-session
The identifier still matches, Server-ID reuse — a player disconnecting and the next joiner inheriting their slot and their session
The session is inside its TTL, A panel left open and walked away from
What gets trusted. Nothing the client says about an item. It sends a bare item key; the server
resolves it against its own catalog and reads the label, weight and stack from there. Unknown keys,
blacklisted items, non-integer counts, counts over the cap, oversized or too-deeply-nested metadata,
and offline targets are all rejected before anything reaches
AddItem. Counts above the cap arerejected rather than clamped, so a malformed request is visible instead of silently shrunk.
There is one
lib.callback.register call site in the resource, and it is inside the wrapper thatapplies the gate — so no endpoint can be added later that forgets it. There are no server-side
RegisterNetEvents at all. Every spawn is written to the console and to lib.logger with theacting admin's name, licence, items and recipients.
How it works
/itemspawner ──▶ lib.addCommand (ACE gate) ──▶ session granted ──▶ open event to that client
│
client builds the grid from its OWN ox_inventory registry ◀────────────────┘
│
└─▶ NUI action ──▶ lib.callback ──▶ session check ──▶ validate ──▶ ox_inventory:AddItemThe item catalog is never sent over the network. ox_inventory maintains a registry on both
sides, so the client builds the grid from its own copy while the server keeps an independent one
purely as the validation authority. Opening the panel costs one small round trip for presets and
the player list, not a 500-item payload.
The grid is row-windowed, so a 500-item catalog mounts about thirty cards at a time instead of
firing 500 image requests on open.
Files
fxmanifest.lua
configs/config.lua command name, locale, icon path (client-safe)
configs/server/security.lua ACE group, caps, rate limit, blacklist (never sent to clients)
shared/catalog.lua ox_inventory registry -> categorised catalog (both sides)
shared/log.lua tagged console logger
client/main.lua locale + module wiring
client/spawner/nui.lua open event, NUI callbacks, focus
server/main.lua locale + module wiring
server/spawner/init.lua the command and the six guarded callbacks
server/spawner/session.lua the grant table and its four-check gate
server/spawner/validate.lua every client payload, rebuilt from scratch
server/spawner/give.lua target resolution and delivery
server/spawner/presets.lua per-admin loadout store (data/presets.json)
server/spawner/audit.lua console + lib.logger trail
web/ the NUI (React + TypeScript + Vite, prebuilt)InstallationDependencies
Resource, What it
…