Neler yeni

Foruma hoş geldin, Ziyaretçi

Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.

Türkiye'nin İlk ve tek FiveM forum adresi

Forum adresimize hoş geldin FiveMTürk olarak amacımız siz değerli kullanıcılarımıza en aktif fikir ve paylaşım platformu sunmak bir yana en güvenilir şekilde alışveriş yapabileceğiniz bir platform sunmaktır.
DF DF
DF DF
DF DF

Script Disc envantere uyumlu ücretsiz log scripti

mass

Üye
FT Kullanıcı
Katılım
3 yıl 8 ay 4 gün
Mesajlar
12
Disc envantere uyumlu ücretsiz log scripti varmıdır ? Piyasada bulunan çoğu log scripti disc envanterle uyumlu değil iyi formlar.
 
DF
Konu tarafımca doğru kategoriye çekilmiştir
Forum üzerinde açmış olduğum Rehber konusuna bakarak kendi log sistemini yapabilirsin.​
 
DF
Merhaba


disc-invetoryhud/server/player.lua içerisinde gelip AddEventHandler('esx:eek:nRemoveInventoryItem', function(source, item, count) ve AddEventHandler('esx:eek:nAddInventoryItem', function(source, esxItem, count) 'lerini aşağıda ki kod gibi değiştirip kolay bir yönden log sistemi oluşturabilirsiniz.




Kod:
AddEventHandler('esx:onRemoveInventoryItem', function(source, item, count)
    local player = ESX.GetPlayerFromId(source)
    xPlayer = player
    TriggerClientEvent('disc-inventoryhud:showItemUse', source, {
        { id = item.name, label = item.label, qty = count, msg = _U('removed') }
    })
    dclog(xPlayer, 'Kişi üzerinden** '..item.name..' **adlı eşyadan** '..count..'** adet sildi.')
    applyToInventory(player.identifier, 'player', function(inventory)
        if impendingRemovals[source] then
            for k, removingItem in pairs(impendingRemovals[source]) do
                if removingItem.id == item.name and removingItem.count == count then
                    if removingItem.block then
                        impendingRemovals[source][k] = nil
                    else
                        removeItemFromSlot(inventory, removingItem.slot, count)
                        impendingRemovals[source][k] = nil
                        TriggerClientEvent('disc-inventoryhud:refreshInventory', source)
                    end
                    return
                end
            end
        end
        removeItemFromInventory(item, count, inventory)
        TriggerClientEvent('disc-inventoryhud:refreshInventory', source)
    end)
end)



AddEventHandler('esx:onAddInventoryItem', function(source, esxItem, count)
    local player = ESX.GetPlayerFromId(source)
    xPlayer = player
    TriggerClientEvent('disc-inventoryhud:showItemUse', source, {
        { id = esxItem.name, label = esxItem.label, qty = count, msg = _U('added') }
    })
    dclog(xPlayer, 'Kişi üzerinden** '..esxItem.name..' **adlı eşyadan** '..count..'** adet ekledi.')
    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 item = createItem(esxItem.name, count)
        addToInventory(item, 'player', inventory, esxItem.limit)
        TriggerClientEvent('disc-inventoryhud:refreshInventory', source)
    end)
end)

function dclog(xPlayer, text)
    local playerName = Sanitize(xPlayer.getName())
 
    local discord_webhook = "https://discord.com/api/webhooks/782294032557539386/Kx5iNSGm7qp7Bp0LG1rnvIKR3OewR1BlI-qbDRH_cwJXzdarEGgwZ5CQuf86Tdy49l6a"
    if discord_webhook == '' then
      return
    end
    local headers = {
      ['Content-Type'] = 'application/json'
    }
    local data = {
      ["username"] = "Barlas Log System",
      ["avatar_url"] = "",
      ["embeds"] = {{
        ["author"] = {
          ["name"] = playerName .. ' - ' .. xPlayer.identifier
        },
        ["color"] = 1942002,
        ["timestamp"] = os.date("!%Y-%m-%dT%H:%M:%SZ")
      }}
    }
    data['embeds'][1]['description'] = text
    PerformHttpRequest(discord_webhook, function(err, text, headers) end, 'POST', json.encode(data), headers)
end

function Sanitize(str)
    local replacements = {
        ['&' ] = '&',
        ['<' ] = '&lt;',
        ['>' ] = '&gt;',
        ['\n'] = '<br/>'
    }

    return str
        :gsub('[&<>\n]', replacements)
        :gsub(' +', function(s)
            return ' '..('&nbsp;'):rep(#s-1)
        end)
end
 
DF
Son düzenleme:
Ücretsiz detaylı ve profesyonel bulabileceğini sanmıyorum eğer olurda ücretli düşünürsen satışını yapıyorum ve en kalitelisi olduğuna eminim :)
 
DF

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap

Bu konuyu görüntüleyen kullanıcılar

Tema düzenleyici

Tema özelletirmeleri

Granit arka planlar

Lütfen Javascript'i etkinleştirin!Javascript'i etkinleştirin!