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

Paylaşım Disc Uyumlu Silah Eklentileri Scripti

  • Konbuyu başlatan exelds
  • Başlangıç tarihi
  • Cevaplar 32
  • Görüntüleme 7K

exelds

Üye
FT Kullanıcı
Katılım
4 yıl 11 ay 15 gün
Mesajlar
245
Selamlar. Bildiğiniz üzere disc-inventoryde eklenti takılı silahınızı belinize koyup tekrar aldığınızda bile tüm silah eklentileri tamamen sıfırlanıyor. Bu konumda kendi yazdığım eklenti scriptini paylaşacağım.

Script Hakkında:
- Bu script sayesinde oyuncu eklenti takılı olan silahını moteline, bagajına vs. koysa bile veya sunucuya restart atılsa bile oyuncunun silahına takmış olduğu eklentiler kaybolmaz.
- Takılan tüm eklentiler "/eklenticikart" komutuyla çıkartılır ve çıkartılan eklentilerin eşyaları geri iade edilmez. Yani eklentiler tek kullanımlıktır. İsteğe göre kendiniz düzenleyebilirsiniz.

Kurulum:

Öncelikle items tablonuza aşağıdaki eşyaları eklemeyi unutmayın. Genelde items tabloları farklı olabildiği için sql dosyasının içine eklemedim.

items tablosuna eklenecekler: "susturucu", "fener", "tutamac", "kaplama", "durbun"

Sonrasında script dosyası içerisinde vermiş olduğum sql dosyasını datanıza çıkartınız.


disc-inventoryhud\client\weapons.lua içerisinde bulunan "GiveWeapon" fonksiyonunu aşağıdaki şekilde güncelleyin:

Kod:
supp1 = {-2084633992, -1357824103, 2132975508, -494615257}
supp2 = {-1716589765, 324215364, -270015777, -1074790547, -1063057011, -1654528753, 984333226}
supp3 = {1593441988, -771403250, 584646201, 137902532, 736523883}
supp4 = {487013001}
flash1 = {453432689, 1593441988, 584646201, -1716589765, -771403250, 324215364}
flash2 = {736523883, -270015777, 171789620, -1074790547, -2084633992, -1357824103, -1063057011, 2132975508, 487013001, -494615257, -1654528753, 984333226}
grip1 = {171789620, -1074790547, -2084633992, -1063057011, 2132975508, 2144741730, -494615257, -1654528753, 984333226}
scope1 = {-2084633992}

function GiveWeapon(weapon)
    local checkh = Config.Throwables
    local playerPed = GetPlayerPed(-1)
    local hash = GetHashKey(weapon)
    ESX.TriggerServerCallback('disc-inventoryhud:getAmmoCount', function(ammoCount, susturucu, fener, tutamac, kaplama, durbun)
        GiveWeaponToPed(playerPed, hash, 1, false, true)

        if susturucu == 1 then
            if hash == GetHashKey("WEAPON_PISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("component_at_pi_supp_02"))
            elseif table.includes(supp1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x837445AA)
            elseif table.includes(supp2, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xA73D4664)
            elseif table.includes(supp3, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xC304849A)
            elseif table.includes(supp4, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xE608B35E)
            end
        end

        if fener == 1 then
            if table.includes(flash1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x359B7AAE)
            elseif table.includes(flash2, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x7BC4CDDC)
            end
        end

        if tutamac ==  1 then
            if table.includes(grip1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xC164F53)
            end
        end

        if kaplama == 1 then
            if hash == GetHashKey("WEAPON_PISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("COMPONENT_PISTOL_VARMOD_LUXE"))
            elseif hash == GetHashKey("WEAPON_PISTOL50") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_PISTOL50_VARMOD_LUXE"))
            elseif hash == GetHashKey("WEAPON_APPISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_APPISTOL"), GetHashKey("COMPONENT_APPISTOL_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_HEAVYPISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYPISTOL"), GetHashKey("COMPONENT_HEAVYPISTOL_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_SMG") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SMG"), GetHashKey("COMPONENT_SMG_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_MICROSMG") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MICROSMG"), GetHashKey("COMPONENT_MICROSMG_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_ASSAULTRIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTRIFLE"), GetHashKey("COMPONENT_ASSAULTRIFLE_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_CARBINERIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_CARBINERIFLE_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_ADVANCEDRIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ADVANCEDRIFLE"), GetHashKey("COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE"))
            end
        end

        if durbun ==  1 then
            if table.includes(scope1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xA0D89C42)
            end
        end

        if checkh[weapon] == hash then     
            SetPedAmmo(playerPed, hash, 1)
        elseif Config.FuelCan == hash and ammoCount == nil then
            SetPedAmmo(playerPed, hash, 1000)
        else
            SetPedAmmo(playerPed, hash, ammoCount or 0)
        end
    end, hash)
end

function table.includes(table, element)
    for _, value in pairs(table) do
        if value == element then
            return true
        end
    end
    return false
end

Sonrasında disc-inventoryhud\server\weapons.lua içerisinde "disc-inventoryhud:getAmmoCount" isimli ServerCallback'i aşağıdaki kodla değiştirin:

Kod:
ESX.RegisterServerCallback('disc-inventoryhud:getAmmoCount', function(source, cb, hash)
    local _source = source
    local player = ESX.GetPlayerFromId(_source)
    MySQL.Async.fetchAll('SELECT * FROM disc_ammo WHERE owner = @owner and hash = @hash', {
        ['@owner'] = player.identifier,
        ['@hash'] = hash
    }, function(results)
        if #results == 0 then
            cb(nil)
        else
            cb(results[1].count, results[1].susturucu, results[1].fener, results[1].tutamac, results[1].kaplama, results[1].durbun, ammoCount, susturucu, fener, tutamac, kaplama, durbun)
        end
    end)
end)

Bunları da yaptıktan sonra scripte start vermekten başka yapmanız gereken birşey kalmıyor. Umarım sorunsuz kullanabilirsiniz.


 
Son düzenleme:
Selamlar. Bildiğiniz üzere disc-inventoryde eklenti takılı silahınızı belinize koyup tekrar aldığınızda bile tüm silah eklentileri tamamen sıfırlanıyor. Bu konumda kendi yazdığım eklenti scriptini paylaşacağım.

Script Hakkında:
- Bu script sayesinde oyuncu eklenti takılı olan silahını moteline, bagajına vs. koysa bile veya sunucuya restart atılsa bile oyuncunun silahına takmış olduğu eklentiler kaybolmaz.
- Takılan tüm eklentiler "/eklenticikart" komutuyla çıkartılır ve çıkartılan eklentilerin eşyaları geri iade edilmez. Yani eklentiler tek kullanımlıktır. İsteğe göre kendiniz düzenleyebilirsiniz.

Kurulum:

Öncelikle items tablonuza aşağıdaki eşyaları eklemeyi unutmayın. Genelde items tabloları farklı olabildiği için sql dosyasının içine eklemedim.

items tablosuna eklenecekler: "susturucu", "fener", "tutamac", "kaplama", "durbun"

Sonrasında script dosyası içerisinde vermiş olduğum sql dosyasını datanıza çıkartınız.


disc-inventoryhud\client\weapons.lua içerisinde bulunan "GiveWeapon" fonksiyonunu aşağıdaki şekilde güncelleyin:

Kod:
supp1 = {-2084633992, -1357824103, 2132975508, -494615257}
supp2 = {-1716589765, 324215364, -270015777, -1074790547, -1063057011, -1654528753, 984333226}
supp3 = {1593441988, -771403250, 584646201, 137902532, 736523883}
supp4 = {487013001}
flash1 = {453432689, 1593441988, 584646201, -1716589765, -771403250, 324215364}
flash2 = {736523883, -270015777, 171789620, -1074790547, -2084633992, -1357824103, -1063057011, 2132975508, 487013001, -494615257, -1654528753, 984333226}
grip1 = {171789620, -1074790547, -2084633992, -1063057011, 2132975508, 2144741730, -494615257, -1654528753, 984333226}
scope1 = {-2084633992}

function GiveWeapon(weapon)
    local checkh = Config.Throwables
    local playerPed = GetPlayerPed(-1)
    local hash = GetHashKey(weapon)
    ESX.TriggerServerCallback('disc-inventoryhud:getAmmoCount', function(ammoCount, susturucu, fener, tutamac, kaplama, durbun)
        GiveWeaponToPed(playerPed, hash, 1, false, true)

        if susturucu == 1 then
            if hash == GetHashKey("WEAPON_PISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("component_at_pi_supp_02"))
            elseif table.includes(supp1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x837445AA)
            elseif table.includes(supp2, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xA73D4664)
            elseif table.includes(supp3, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xC304849A)
            elseif table.includes(supp4, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xE608B35E)
            end
        end

        if fener == 1 then
            if table.includes(flash1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x359B7AAE)
            elseif table.includes(flash2, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0x7BC4CDDC)
            end
        end

        if tutamac ==  1 then
            if table.includes(grip1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xC164F53)
            end
        end

        if kaplama == 1 then
            if hash == GetHashKey("WEAPON_PISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL"), GetHashKey("COMPONENT_PISTOL_VARMOD_LUXE"))
            elseif hash == GetHashKey("WEAPON_PISTOL50") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PISTOL50"), GetHashKey("COMPONENT_PISTOL50_VARMOD_LUXE"))
            elseif hash == GetHashKey("WEAPON_APPISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_APPISTOL"), GetHashKey("COMPONENT_APPISTOL_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_HEAVYPISTOL") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_HEAVYPISTOL"), GetHashKey("COMPONENT_HEAVYPISTOL_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_SMG") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_SMG"), GetHashKey("COMPONENT_SMG_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_MICROSMG") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_MICROSMG"), GetHashKey("COMPONENT_MICROSMG_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_ASSAULTRIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTRIFLE"), GetHashKey("COMPONENT_ASSAULTRIFLE_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_CARBINERIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_CARBINERIFLE_VARMOD_LUXE"))

            elseif hash == GetHashKey("WEAPON_ADVANCEDRIFLE") then
                GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ADVANCEDRIFLE"), GetHashKey("COMPONENT_ADVANCEDRIFLE_VARMOD_LUXE"))
            end
        end

        if durbun ==  1 then
            if table.includes(scope1, hash) then
                GiveWeaponComponentToPed(GetPlayerPed(-1), hash, 0xA0D89C42)
            end
        end

        if checkh[weapon] == hash then     
            SetPedAmmo(playerPed, hash, 1)
        elseif Config.FuelCan == hash and ammoCount == nil then
            SetPedAmmo(playerPed, hash, 1000)
        else
            SetPedAmmo(playerPed, hash, ammoCount or 0)
        end
    end, hash)
end

Sonrasında disc-inventoryhud\server\weapons.lua içerisinde "disc-inventoryhud:getAmmoCount" isimli ServerCallback'i aşağıdaki kodla değiştirin:

Kod:
ESX.RegisterServerCallback('disc-inventoryhud:getAmmoCount', function(source, cb, hash)
    local _source = source
    local player = ESX.GetPlayerFromId(_source)
    MySQL.Async.fetchAll('SELECT * FROM disc_ammo WHERE owner = @owner and hash = @hash', {
        ['@owner'] = player.identifier,
        ['@hash'] = hash
    }, function(results)
        if #results == 0 then
            cb(nil)
        else
            cb(results[1].count, results[1].susturucu, results[1].fener, results[1].tutamac, results[1].kaplama, results[1].durbun, ammoCount, susturucu, fener, tutamac, kaplama, durbun)
        end
    end)
end)

Bunları da yaptıktan sonra scripte start vermekten başka yapmanız gereken birşey kalmıyor. Umarım sorunsuz kullanabilirsiniz.


Güzel paylaşım
 
Güzel paylaşım
 
sql'de column hatası alıyorum
 
exelds exelds naısl ekleyebilirim sql bilgim yok tablonun içine mi yoksa direkt olarak tabloyamı
 
30404

sql bilgim yok nasıl ekleyebilirim söyleyecek bir arkadaş varsa şimdiden teşekkürler
 
client tarafında bi fonksiyon eksik olduğu için alınan hata düzeltildi. Hata alan arkadaşlar client tarafını tekrar kopyala yapıştır atarak sorunu düzeltebilirler.
 
*
 
Son düzenleme:
mk2 silahları nasıl ekleyebilirim yada eklenmiş olan varsa atabilirsmisiniz
 
Discorddan gelen öneriler üzerine Uzatılmış Şarjör eklenmiştir. Scriptin güncel versiyonu ve kurulum ayrıntıları discord kanalımda mevcuttur.

12 saat içerisinde discord yönlendirmelerini kaldırmaz iseniz konunuz kapatılacaktır​
 
Hocam eklentiler save olmuyor silahı bırakıp geri alınca gidiyor
 
Güzel paylaşım​
 
uzatılmış şarjorde eklenirse mükemmel olur
 
Ellerine sağlık.
 
güzel paylaşım
 

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!