Jump to content
Fivem-DEV.cz
  • 0
Sign in to follow this  
Bolat

INVENTORY HELP

Question

Zdravim , potřebuji pomoc s inventarem.
error :
image.png.ab20024919d6bf8f203e83c7bca4fc3b.png
 error se ukáže vždy když použiju item , jde použit jednou a poté to napise nad mapou Impossible.

řádek :
163 - 168

 

Quote

function getCustomD(itemn)
    local getitem = MySQL.Sync.fetchAll("SELECT * FROM items WHERE items.name =@name", {
        ['@name'] = itemn
    })
    return getitem[1].durability
end
errory na radku :

167 : return getitem[1].durability

232-254
 

Quote

AddEventHandler('esx:onAddInventoryItem', function(source, esxItem, count)
    local player = ESX.GetPlayerFromId(source)
    TriggerClientEvent('disc-inventoryhud:showItemUse', source, {
        { id = esxItem.name, label = esxItem.label, qty = count, msg = _U('added') }
    })
    applyToInventory(player.identifier, 'player', function(inventory)
        if impendingAdditions[source] then
            for k, addingItem in pairs(impendingAdditions[source]) do
                if addingItem.id == esxItem.name and addingItem.count == count then
                    if addingItem.block then
                        impendingAdditions[source][k] = nil
                        return
                    end
                end
            end
        end
        local durability = getCustomD(esxItem.name)
        local serie = getCustomSerie(esxItem.name)
        local item = createItem(esxItem.name, count, durability, serie)
        addToInventory(item, 'player', inventory, esxItem.limit)
        TriggerClientEvent('disc-inventoryhud:refreshInventory', source)
    end)
end)


errory na radku :
237 : applyToInventory(player.identifier, 'player', function(inventory)
248 : local durability = getCustomD(esxItem.name)

1249 - 1262
 

Quote

function applyToInventory(identifier, type, f)
    if loadedInventories[type][identifier] ~= nil then
        f(loadedInventories[type][identifier])
    else
        loadInventory(identifier, type, function()
            applyToInventory(identifier, type, f)
        end)
    end
    if loadedInventories[type][identifier] and table.length(loadedInventories[type][identifier]) > 0 then
        TriggerEvent('disc-inventoryhud:modifiedInventory', identifier, type, loadedInventories[type][identifier])
    else
        TriggerEvent('disc-inventoryhud:modifiedInventory', identifier, type, nil)
    end
end

errory na radku :
1251 :  f(loadedInventories[type][identifier])

Dekuji za rady a pomoc :)

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

Our partners

rcore.cz
K4mb1
SLTH
×
×
  • Create New...