This leak is so nice !!!0r-Craft + 0r-lib
0r Craft with 0r lib in one pack, for ESX and QBCore. Works with Ox Inventory, QB Inventory.
It's completely open source.
This pack its 100% work, same my other post.
If you liked it, please leave a comment, thank you!
Preview:
-=Stripped Content=-
good one nice bro asowm0r-Craft + 0r-lib
0r Craft with 0r lib in one pack, for ESX and QBCore. Works with Ox Inventory, QB Inventory.
It's completely open source.
This pack its 100% work, same my other post.
If you liked it, please leave a comment, thank you!
Preview:
-=Stripped Content=-
go to 0r-craft and go to the bottom of page and replace this code, it is working without the lib, make sure you insert database file0r_lib/server.main.lua
There are some problems, add some and let's put it together.
Resmon = {}
Resmon.Callbacks = {}
Resmon.UsableItems = {}
-- Callback fonksiyonları
function Resmon.RegisterCallback(name, callback)
Resmon.Callbacks[name] = callback
end
function Resmon.TriggerCallback(name, source, cb, ...)
if Resmon.Callbacks[name] then
Resmon.Callbacks[name](source, cb, ...)
else
print("Callback " .. name .. " bulunamadı.")
end
end
-- Usable item fonksiyonları
function Resmon.RegisterUsableItem(itemName, callback)
Resmon.UsableItems[itemName] = callback
end
function Resmon.UseItem(source, item)
local usableItem = Resmon.UsableItems[item.name]
if usableItem then
usableItem(source, item)
else
print("Usable item " .. item.name .. " bulunamadı.")
end
end
-- Kod oluşturma fonksiyonu
function Resmon.GenerateCode()
-- Burada bir rastgele kod oluşturabilirsiniz, örneğin:
local length = 6
local charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
local code = ""
for i = 1, length do
local randomChar = charset:sub(math.random(1, #charset), math.random(1, #charset))
code = code .. randomChar
end
return code
end
-- Oyuncu adını döndüren fonksiyon
function Resmon.GetPlayerOfflineName(owner)
-- Burada veritabanından veya başka bir kaynaktan oyuncu adını alabilirsiniz
-- Örnek dönüş:
local playerName = "Bilinmeyen Oyuncu"
-- Veritabanından oyuncu adını çekmek için örnek MySQL sorgusu:
--[[
local result = MySQL.Sync.fetchScalar("SELECT name FROM users WHERE identifier = @owner", {["@owner"] = owner})
if result then
playerName = result
end
--]]
return playerName
end
-- GetPlayerFromSource fonksiyonu (qb-core global fonksiyon örneği)
function Resmon.GetPlayerFromSource(source)
local xPlayer = QBCore.Functions.GetPlayer(source)
return xPlayer
end
-- Register the functions to Resmon.Lib
Resmon = Resmon or {}
Resmon.Lib = Resmon.Lib or {}
Resmon.Lib.Callback = Resmon.Lib.Callback or {}
Resmon.Lib.Callback.Register = Resmon.RegisterCallback
Resmon.Lib.Callback.Trigger = Resmon.TriggerCallback
Resmon.Lib.RegisterUsableItem = Resmon.RegisterUsableItem
Resmon.Lib.UseItem = Resmon.UseItem
Resmon.Lib.GenerateCode = Resmon.GenerateCode -- Register the GenerateCode function
Resmon.Lib.GetPlayerOfflineName = Resmon.GetPlayerOfflineName -- Register the GetPlayerOfflineName function
Resmon.Lib.GetPlayerFromSource = Resmon.GetPlayerFromSource -- Register the GetPlayerFromSource function
-- QB-Core'dan gerekli core objesini almak için
function QBCoreObject()
return QBCore
end
-- Exports
exports('QBCoreObject', QBCoreObject)
go to 0r-craft and go to the bottom of page and replace this code, it is working without the lib, make sure you insert database file
function Koci.Server.Craft:InsertQueueToDB(xPlayer, item, canItBeCraftable)
if not xPlayer or not item then return -1 end
local user = xPlayer.identifier or xPlayer.PlayerData.citizenid or "unknown"
local name = item.name or "unknown"
local label = item.label or "Without name"
local count = item.count or 1
local image = item.image or ""
local ingredients = item.ingredients or {}
local encodedIngredients = json.encode(ingredients)
local propModel = item.propModel or ""
local price = item.price or 0
local canCraft = canItBeCraftable and 1 or 0
local status = item.status or "waiting"
local timestamp = os.date('%Y-%m-%d %H:%M:%S')
local insertId = -1
exports.oxmysql:insert([[
INSERT INTO `0r_crafting_queue`
(`user`, `name`, `label`, `count`, `image`, `ingredients`, `propModel`, `price`, `canItBeCraftable`, `status`, `created_at`, `updated_at`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
]], {
user, name, label, count, image, encodedIngredients, propModel, price, canCraft, status, timestamp, timestamp
}, function(id)
insertId = id or -1
print(('[Crafting] Inserting in database %s | Item: %s | ID: %s'):format(user, name, insertId))
end)
return insertId
end
replace withfunction Koci.Server.Craft:InsertQueueToDB(xPlayer, item, canItBeCraftable)
if Koci.ResmonLib then
local _id = Koci.ResmonLib.Craft.InsertQueueToDB(xPlayer, item, canItBeCraftable)
return _id
else
return -1
end
end
function Koci.Server.Craft:InsertQueueToDB(xPlayer, item, canItBeCraftable)
if not xPlayer or not item then return -1 end
local user = xPlayer.identifier or xPlayer.PlayerData.citizenid or "unknown"
local name = item.name or "unknown"
local label = item.label or "Without name"
local count = item.count or 1
local duration = item.duration or 1
local image = item.image or ""
local ingredients = item.ingredients or {}
local encodedIngredients = json.encode(ingredients)
local propModel = item.propModel or ""
local price = item.price or 0
local canCraft = canItBeCraftable and 1 or 0
local status = item.status or "in_progress"
local timestamp = os.date('%Y-%m-%d %H:%M:%S')
local insertId = -1
exports.oxmysql:insert([[
INSERT INTO `0r_crafting_queue`
(`user`, `name`, `label`, `count`, `duration`, `image`, `ingredients`, `propModel`, `price`, `canItBeCraftable`, `status`, `created_at`, `updated_at`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
]], {
user, name, label, count, duration, image, encodedIngredients, propModel, price, canCraft, status, timestamp, timestamp
}, function(id)
insertId = id or -1
print(('[Crafting] Inserting in database %s | Item: %s | ID: %s'):format(user, name, insertId))
end)
return insertId
end
Koci.ResmonLib = Utils.Functions:GetResmonLib()
function Utils.Functions:GetResmonLib()
if self:hasResource("0r_lib") then
return exports["0r_lib"]:GetCoreObject().Lib
else
CreateThread(function()
Wait(30000)
selfrintTable("^1!!! The installation could not be done because the 0r_lib could not be found !!!")
end)
return false
end
end
is it for qb or esx serveurgo to 0r-craft and go to the bottom of page and replace this code, it is working without the lib, make sure you insert database file
function Koci.Server.Craft:InsertQueueToDB(xPlayer, item, canItBeCraftable)
if not xPlayer or not item then return -1 end
local user = xPlayer.identifier or xPlayer.PlayerData.citizenid or "unknown"
local name = item.name or "unknown"
local label = item.label or "Without name"
local count = item.count or 1
local image = item.image or ""
local ingredients = item.ingredients or {}
local encodedIngredients = json.encode(ingredients)
local propModel = item.propModel or ""
local price = item.price or 0
local canCraft = canItBeCraftable and 1 or 0
local status = item.status or "waiting"
local timestamp = os.date('%Y-%m-%d %H:%M:%S')
local insertId = -1
exports.oxmysql:insert([[
INSERT INTO `0r_crafting_queue`
(`user`, `name`, `label`, `count`, `image`, `ingredients`, `propModel`, `price`, `canItBeCraftable`, `status`, `created_at`, `updated_at`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
]], {
user, name, label, count, image, encodedIngredients, propModel, price, canCraft, status, timestamp, timestamp
}, function(id)
insertId = id or -1
print(('[Crafting] Inserting in database %s | Item: %s | ID: %s'):format(user, name, insertId))
end)
return insertId
end