Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.

chore: introduce the possibility of eating tuna sandwich#1034

Merged
bitpredator merged 2 commits intomainfrom
dev-bitpredator
Mar 15, 2025
Merged

chore: introduce the possibility of eating tuna sandwich#1034
bitpredator merged 2 commits intomainfrom
dev-bitpredator

Conversation

@bitpredator
Copy link
Owner

Fixes #[issue_no]

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Does your submission pass tests?

Please describe the changes this PR makes and why it should be merged:

Discord username (if different from GitHub):

1. General Improvements
- Code optimization to reduce MySQL load.
- Improved ESX object handling using exports["es_extended"]:getSharedObject().

2. Crafting Level System

- Added Functions:
- SetCraftingLevel(identifier, level): Sets a player's crafting level in the database.
- GetCraftingLevel(identifier): Retrieves a player's crafting level.
- GiveCraftingLevel(identifier, level): Adds crafting experience to the player.

Changes:
- Optimized MySQL queries to avoid locking the users table.
- Improved identifier checking to prevent null errors.

3. Server Events
- Logged Events:
- bpt_crafting:setExperiance: Sets a player's crafting level.
- bpt_crafting:giveExperiance: Adds crafting experience.
- bpt_crafting:itemCrafted: Handles item assignment after crafting.
- bpt_crafting:craft: Starts the crafting process.

4. Crafting Function Improvements
- Improved ingredient handling:
- More precise control over ingredients before starting crafting.
- UseLimitSystem control to avoid inventory full issues.
- Added control over permanent items:
- Items designated as "permanent" are not removed from crafting.

SuccessRate fix:
- Crafting success is now correctly determined based on a random value between 0 and the recipe's SuccessRate.

5. Optimized ESX Callbacks
- bpt_crafting:getXP:
- Retrieves crafting level more efficiently.
- bpt_crafting:getItemNames:
- Optimized MySQL query to reduce response time.
@bitpredator bitpredator merged commit d01dbaf into main Mar 15, 2025
5 of 6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant