Temporary Inventory System

Temporary Inventory System

Este artículo es gratis.

Add to Basket

Temporary Inventory System (ESX / QBCore)

NB-InvRestored is a server-side inventory management system for FiveM designed to temporarily save, clear, modify, and restore player inventories in a safe and controlled way.
Built for events, PvP modes, missions, minigames, and special zones.

Fully compatible with ESX and QBCore, with automatic framework detection.


Main Features

  • ESX and QBCore compatible

  • Automatic framework detection (or manual override)

  • Temporary inventory saving in database

  • Automatic expiration of stored inventories

  • Restore inventories with optional reward items

  • Clear inventories with item exclusions

  • Inventory manipulation via server exports

  • Integrated notifications (ESX / QBCore)

  • Debug mode with test commands


Use Cases

  • PvP events with temporary loadouts

  • Minigames with isolated inventories

  • Missions with custom equipment

  • Event zones with restricted items

  • Any system requiring inventory rollback


Requirements

  • ESX or QBCore

  • oxmysql

  • qb-inventory (only if using QBCore)


Installation

  1. Place the resource in your resources folder

  2. Add to server.cfg:

    ensure nb-invrestored
    
  3. Restart the server

  4. Database table is created automatically


Configuration

All configuration is handled in config.lua.

Key options:

  • Framework auto-detection or manual selection

  • Inventory expiration time (hours)

  • Debug mode

  • Custom notification messages


Available Server Exports

Save Inventory

Stores the current inventory with optional metadata.

exports['nb-invrestored']:SaveInventory(source, metadata)

Restore Inventory

Restores the saved inventory, optionally clearing the current one and adding reward items.

exports['nb-invrestored']:RestoreInventory(source, clearCurrent, additionalItems)

Clear Inventory

Clears inventory with optional excluded items.

exports['nb-invrestored']:ClearInventory(source, excludeItems)

Give Items

Gives items directly to the player.

exports['nb-invrestored']:GiveItems(source, items)

Get Saved Inventory

Returns saved inventory data without restoring it.

exports['nb-invrestored']:GetSavedInventory(source)

Important Notes

  • Only one saved inventory per player

  • Saved inventories auto-delete after expiration time

  • Restoring an inventory deletes the saved data

  • Framework differences are handled internally


Debug Mode

When enabled, test commands are available:

  • /nb-inv-save

  • /nb-inv-restore

  • /nb-inv-clear

Debug mode is disabled by default.