[FREE] [QBCore] alpha-craftingV2 | Crafting Stations


can someone help me? whats wrong?

what are needed to add multi locations copy pasted one of the ones youve made to try to get more locations out there so peps wont be stacked up creating guns in a bunch :smiley: And that wasnt the trouble tried adding a new poly Box didnt fix it so im thinking about maybe som stuff the needs to go away to be able to be created :smiley:

local function RefreshPlayerData()
local PlayerData = QBCore.Functions.GetPlayerData()
QBCore.Functions.TriggerCallback(“alpha-craftingV2:Server:GetPlayerLevelStatus”, function(cb)
if cb then
PlayerInfo.PlayerLevel = cb.PlayerLevel
PlayerInfo.PlayerXP = cb.PlayerXP
end
end, PlayerData.citizenid)
PlayerInfo.PlayerJob = PlayerData.job.name
end

local function CheckForCraft(data)
local ItemCategory = string.match(data.data, “:(.)")
local ItemsInfo = Config.CraftingStations[string.lower(ItemCategory)]
local ItemName = string.match(data.data, "(.
):”)
local ItemNameLower = string.lower(ItemName)
local ItemInfo = {}

for index, value in ipairs(ItemsInfo.Crafts) do
    if value.Item == ItemNameLower then
        ItemInfo = value
    end
end

if PlayerInfo and PlayerInfo.PlayerLevel and type(PlayerInfo.PlayerLevel) == "number" and ItemInfo and ItemInfo.Level and type(ItemInfo.Level) == "number" and PlayerInfo.PlayerLevel >= ItemInfo.Level then
    if ItemInfo.Jobs and type(ItemInfo.Jobs) == "table" and ItemInfo.Jobs > 0 then
        if PlayerInfo.PlayerJob and HasValue(ItemInfo.Jobs, PlayerInfo.PlayerJob) then
            TriggerServerEvent("alpha-craftingV2:Server:CraftItemFinal", ItemInfo)
        else
            QBCore.Functions.Notify("Votre job n'est pas si bienvenue pour fabriquer cet Item", "error", 2000)
        end
    else
        TriggerServerEvent("alpha-craftingV2:Server:CraftItemFinal", ItemInfo)
    end
else
    QBCore.Functions.Notify("Il vous faut atteindre un plus grand niveau pour fabriquer cet Item", "error", 2000)
end

end

try this

freedom to da people blub blub!!!
heres the fix at least it fixed for me
you cant leave the menu while crafting or it stops other then that works great etc

Must restart server for it take effect or your level stays nil!!

file:

just replace the client.lua with this

Thats very helpful, I used your code. And wonder if this suppose to happen

is a fix for the one file, seems to me your missing the sql database or didnt install it correctly, my fix was for the error: attempt to compare number with nil
so my fix worked :stuck_out_tongue:

use this to maybe help get started with a sql base an fivem

ahh, becauise I only got one of the two columns :smiley:

stuck how dowe get the items for the weapons?

Maybe a copy, but these days its difficult to come with new stuff! And This guy make it for free!

Big up @Alphazinn

1 Like