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

Soru Fivem bu envanteri başkası kurcalıyor sorunu

simolf

Üye
FT Kullanıcı
Katılım
1 yıl 6 ay 26 gün
Mesajlar
34
merhaba
Kod:
RegisterServerEvent("inventory:server:OpenInventory")
AddEventHandler('inventory:server:OpenInventory', function(name, id, other)
    local src = source
    local stringSrc = tostring(src)

    -- ! BEGIN
    if name ~= nil and id ~= nil then
        local deger = nil
        if name ~= "shop" then
            if type(id) ~= "string" then deger = tostring(id) else deger = id end
            -- print("^2ENV DEĞER 1 :", json.encode(acikEnvanterler))
            if acikEnvanterler[deger] and acikEnvanterler[deger][stringSrc] then else
                if not acikEnvanterler[deger] and not acikEnvanterler[stringSrc] then
                    acikEnvanterler[deger] = {}   
                    acikEnvanterler[deger][stringSrc] = true
                    acikEnvanterler[stringSrc] = {}   
                    acikEnvanterler[stringSrc][stringSrc] = true
                else
                    TriggerClientEvent('lynx-dataSifirla', src)
                    TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
                    return
                end
            end
            -- print("^2ENV DEĞER 2 :", json.encode(acikEnvanterler))
        end
    else
        -- print("^2KİŞİSEL ENV DEĞER 1 :", json.encode(acikEnvanterler))
        if not acikEnvanterler[stringSrc] or acikEnvanterler[stringSrc][stringSrc] then
            acikEnvanterler[stringSrc] = {}
            acikEnvanterler[stringSrc][stringSrc] = true
        else
            TriggerClientEvent('lynx-dataSifirla', src)
            TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
            return
        end
        -- print("^2KİŞİSEL ENV DEĞER 2 :", json.encode(acikEnvanterler))
    end

qb-inventory kullanıyorum oldqb paket

mesela yere birisi eşya koyduğunda açamıyorum bu envanteri şu an başkası kurcalıyor sorunu veriyor aşırı buglu. bunun olduğu kod satırı burada, buna nasıl çözüm getirebilirim?
 
DF
merhaba
Kod:
RegisterServerEvent("inventory:server:OpenInventory")
AddEventHandler('inventory:server:OpenInventory', function(name, id, other)
    local src = source
    local stringSrc = tostring(src)

    -- ! BEGIN
    if name ~= nil and id ~= nil then
        local deger = nil
        if name ~= "shop" then
            if type(id) ~= "string" then deger = tostring(id) else deger = id end
            -- print("^2ENV DEĞER 1 :", json.encode(acikEnvanterler))
            if acikEnvanterler[deger] and acikEnvanterler[deger][stringSrc] then else
                if not acikEnvanterler[deger] and not acikEnvanterler[stringSrc] then
                    acikEnvanterler[deger] = {}  
                    acikEnvanterler[deger][stringSrc] = true
                    acikEnvanterler[stringSrc] = {}  
                    acikEnvanterler[stringSrc][stringSrc] = true
                else
                    TriggerClientEvent('lynx-dataSifirla', src)
                    TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
                    return
                end
            end
            -- print("^2ENV DEĞER 2 :", json.encode(acikEnvanterler))
        end
    else
        -- print("^2KİŞİSEL ENV DEĞER 1 :", json.encode(acikEnvanterler))
        if not acikEnvanterler[stringSrc] or acikEnvanterler[stringSrc][stringSrc] then
            acikEnvanterler[stringSrc] = {}
            acikEnvanterler[stringSrc][stringSrc] = true
        else
            TriggerClientEvent('lynx-dataSifirla', src)
            TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
            return
        end
        -- print("^2KİŞİSEL ENV DEĞER 2 :", json.encode(acikEnvanterler))
    end

qb-inventory kullanıyorum oldqb paket

mesela yere birisi eşya koyduğunda açamıyorum bu envanteri şu an başkası kurcalıyor sorunu veriyor aşırı buglu. bunun olduğu kod satırı burada, buna nasıl çözüm getirebilirim?
-- Şunu dene bakalım eğer adamın envanteri açıksa açık olan kullanıcıya bildirip gönderip envanteri kapatırıyor olması gerek
Kod:
RegisterServerEvent("inventory:server:OpenInventory")
AddEventHandler('inventory:server:OpenInventory', function(name, id, other)
    local src = source
    local stringSrc = tostring(src)

    -- ! BEGIN
    if name ~= nil and id ~= nil then
        local deger = nil
        if name ~= "shop" then
            if type(id) ~= "string" then deger = tostring(id) else deger = id end

            if not acikEnvanterler[deger] then
                acikEnvanterler[deger] = {}
            end

            if not acikEnvanterler[deger][stringSrc] then
                for k, _ in pairs(acikEnvanterler[deger]) do
                    TriggerClientEvent('lynx-dataSifirla', tonumber(k))
                    TriggerClientEvent("QBCore:Notify", tonumber(k), "Bu envanteri şu an başkası kurcalıyor!")
                end
                acikEnvanterler[deger] = {}
                acikEnvanterler[deger][stringSrc] = true
            else
                TriggerClientEvent('lynx-dataSifirla', src)
                TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
                return
            end
        end
    else
        if not acikEnvanterler[stringSrc] then
            acikEnvanterler[stringSrc] = {}
            acikEnvanterler[stringSrc][stringSrc] = true
        else
            TriggerClientEvent('lynx-dataSifirla', src)
            TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
            return
        end
    end
end)
 
DF
-- Şunu dene bakalım eğer adamın envanteri açıksa açık olan kullanıcıya bildirip gönderip envanteri kapatırıyor olması gerek
Kod:
RegisterServerEvent("inventory:server:OpenInventory")
AddEventHandler('inventory:server:OpenInventory', function(name, id, other)
    local src = source
    local stringSrc = tostring(src)

    -- ! BEGIN
    if name ~= nil and id ~= nil then
        local deger = nil
        if name ~= "shop" then
            if type(id) ~= "string" then deger = tostring(id) else deger = id end

            if not acikEnvanterler[deger] then
                acikEnvanterler[deger] = {}
            end

            if not acikEnvanterler[deger][stringSrc] then
                for k, _ in pairs(acikEnvanterler[deger]) do
                    TriggerClientEvent('lynx-dataSifirla', tonumber(k))
                    TriggerClientEvent("QBCore:Notify", tonumber(k), "Bu envanteri şu an başkası kurcalıyor!")
                end
                acikEnvanterler[deger] = {}
                acikEnvanterler[deger][stringSrc] = true
            else
                TriggerClientEvent('lynx-dataSifirla', src)
                TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
                return
            end
        end
    else
        if not acikEnvanterler[stringSrc] then
            acikEnvanterler[stringSrc] = {}
            acikEnvanterler[stringSrc][stringSrc] = true
        else
            TriggerClientEvent('lynx-dataSifirla', src)
            TriggerClientEvent("QBCore:Notify", src, "Bu envanteri şu an başkası kurcalıyor!")
            return
        end
    end
end)
f2'ye basınca envanter açılmıyor bu kodu kullanınca
 
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!