Skip to content

feat(es_extended): refresh/add items during runtime#1671

Merged
Kenshiin13 merged 8 commits into
esx-framework:devfrom
Kenshiin13:add-refresh-items
Jul 25, 2025
Merged

feat(es_extended): refresh/add items during runtime#1671
Kenshiin13 merged 8 commits into
esx-framework:devfrom
Kenshiin13:add-refresh-items

Conversation

@Kenshiin13

@Kenshiin13 Kenshiin13 commented Jul 13, 2025

Copy link
Copy Markdown
Contributor

Description

Adds support for creating and refreshing items at runtime.


Motivation

Improves development workflows by allowing items to be added or refreshed dynamically.
While it's not recommended to refresh items in prod, third-party scripts can call ESX.AddItems during startup to register required items without relying on a manual items.sql import.


Usage

    ESX.AddItems({
		{
			name = "water", label = "Water"
		},
		{
			name = "pd_gadget", label = "PD-Gadget", weight = 10, rare = true, canRemove = false
		},
		{
			name = "bread", label = "Bread"
		},
	})

PR Checklist

  • My commit messages and PR title follow the Conventional Commits standard.
  • My changes have been tested locally and work as intended.
  • This PR does not introduce any breaking changes.
  • I’ve included a clear explanation and context for the changes in this PR.

@github-project-automation github-project-automation Bot moved this to 🆕 To be Discussed in ESX Roadmap Jul 13, 2025

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add correct locales when registering refresh items command.
Edit:
Check if item does exist if it does then skip to continue (check only name type first and if the item doesn't exist check other types)
Use prepare instead of query in refreshitems
^ zykem

If you want you can also includes those micro optimizations:

  1. Use numeric loop instead of ipairs
  2. Unpack a table using indexes instead of "unpack" function

Also you can add notifying player how many items there are in the database. How many are loaded.

Spoiler Use snake case in local variables 🔥

@github-project-automation github-project-automation Bot moved this from 🆕 To be Discussed to In-Development in ESX Roadmap Jul 25, 2025
@Kenshiin13 Kenshiin13 requested a review from Kr3mu July 25, 2025 09:45

@Kr3mu Kr3mu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-project-automation github-project-automation Bot moved this from In-Development to Ready for Next Update in ESX Roadmap Jul 25, 2025
@Kenshiin13

Copy link
Copy Markdown
Contributor Author

@Kenshiin13 Kenshiin13 merged commit 64ff97d into esx-framework:dev Jul 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Next Update

Development

Successfully merging this pull request may close these issues.

3 participants