py_imagedetector is a server-side FiveM resource that scans ox_inventory or qb-inventory for missing and unused item images.
It provides a fast and reliable way to ensure your inventory setup is clean and all items display correctly in the UI.
Note:
- This script is intended for debugging purposes only and should be used by developers or server owners with full access to a localhost or Windows server. If you do not meet these requirements or do not intend to use the script, set
Config.Enabledto false. - This requires ox_lib for proper resource handling. Make sure this dependency is installed and running.
- The script reads items from both
items.luaandweapons.lua, including Weapons, Components, and Ammo categories. - This script currently only supports ox_inventory and qb-inventory, but you can add additional inventories if you want. Only do this if you have the knowledge to do so, as no support will be provided. If it works, submit a PR so I can include it for others.
The script automatically compares:
- All items registered (including weapons, components, and ammo)
- All image files in the inventory image folder
It then reports:
- Items that do not have a corresponding image
- Images that are not associated with any item
All results are logged clearly in the server console.
- Case-insensitive item-to-image matching (e.g.,
WEAPON_ASSAULTRIFLEmatchesweapon_assaultrifle.png) (configurable viaConfig.CaseSensitive) - Detects missing images for inventory items
- Detects unused images that are not linked to any item
- Supports items, weapons, components, and ammo
- Lightweight and server-side only
- Clean, structured console output with summary
- Waits briefly after the resource starts to ensure the inventory is fully loaded.
- Reads all items via
items.luaandweapons.lua(Weapons, Components, Ammo). - Scans the inventory image folder for
.pngfiles. - Compares items and images (case-insensitive if
Config.CaseSensitive = false). - Logs missing items, unused images, and a summary in the console.
No client-side code is used.
- ox_inventory or qb-inventory
- ox_lib (for proper resource path handling and events)
Ensure both resources are installed and running before using py_imagedetector.
- Place the
py_imagedetectorfolder in your server’sresourcesdirectory. - Add the following lines in order to your
server.cfgif you haven't already:
ensure ox_lib
ensure ox_inventory or qb-inventory
ensure py_imagedetector- Start your server. The image scan will run automatically on resource start.