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

Cevaplandı QB-SHOPS DİYALOG ENTEGRE

infinitumclara

Üye
FT Kullanıcı
Katılım
2 yıl 7 ay 21 gün
Mesajlar
85
Merhaba, ben okok'un diyalog sistemini kullanıyorum. Polis ve EMS de cephanelik ve depoya entegre etmem lazım. fakat event'e nasıl çevirebilirim bilmiyorum. qb-shops kullanıyorum cephanelik için.
 
qb-shops'un client tarafına gir ve
Kod:
if IsControlJustReleased(1, 51) then
    Gunshop()
end
bu şekilde olan kodun (kodyun içinde gunshop yerine başka birşeyde yazabilir) dialog scriptinin triger eventini ekle.
 
qb-shops'un client tarafına gir ve
Kod:
if IsControlJustReleased(1, 51) then
    Gunshop()
end
bu şekilde olan kodun (kodyun içinde gunshop yerine başka birşeyde yazabilir) dialog scriptinin triger eventini ekle.
Kod:
Citizen.CreateThread(function()
    while true do
        local InRange = false
        local PlayerPed = PlayerPedId()
        local PlayerPos = GetEntityCoords(PlayerPed)
        local wait = 2000
        if PlayerData.job then
            for shop, _ in pairs(Config.Locations) do
                if  Config.Locations[shop]["job"] == "all" or Config.Locations[shop]["job"] == PlayerData.job.name then
                    local position = Config.Locations[shop]["coords"]
                    for _, loc in pairs(position) do
                        local dist = #(vector3(PlayerPos) - vector3(loc["x"], loc["y"], loc["z"]))
                        if dist < 3 then
                            DrawMarker(2, loc["x"], loc["y"], loc["z"], 0, 0, 0, 0, 0, 0, 0.2, 0.2, 0.2, 32, 236, 54, 100, 0, 0, 0, 1, 0, 0, 0)                    
                            text = Config.Locations[shop]["label"]
                            wait = 1
                            InRange = true
                         -- DrawMarker(2, loc["x"], loc["y"], loc["z"], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25, 0.2, 0.1, 255, 255, 255, 155, 0, 0, 0, 1, 0, 0, 0)
                            if dist < 1 then
                                text = '[E] - '..text                       
                                if IsControlJustPressed(0, Config.Keys["E"]) then

                                    if Config.Locations[shop]["label"] == "Silahçı" then
                                        if not exports["tq-level"]:checkLevel(3) then
                                            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Silahçı seni tanımıyor.', 'top-center', 5000)
                                            break
                                        end
                                    end

                                    if Config.Locations[shop]["label"] == "Blackmarket" then
                                        if not exports["tq-level"]:checkLevel(3) then
                                            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Satıcı seni tanımıyor.', 'top-center', 5000)
                                            break
                                        end
                                    end

                                    local ShopItems = {}
                                    ShopItems.label = Config.Locations[shop]["label"]
                                    ShopItems.items = Config.Locations[shop]["products"]
                                    ShopItems.slots = 30
                                    TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop_"..shop, ShopItems)
                                end
                            end
                           -- DrawText3D(loc["x"], loc["y"], loc["z"] , text)
                        end
                    end
                end
            end
        end
        Citizen.Wait(wait)
    end
end)

Sadece böyle bir şey var.
 
Önce o createThread i sileceksin, sonra
Kod:
RegisterNetEvent('xxx:xxx:xxx', function()
    if Config.Locations[shop]["label"] == "Silahçı" then
        if not exports["tq-level"]:checkLevel(3) then
            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Silahçı seni tanımıyor.', 'top-center', 5000)
            break
        end
    end

    if Config.Locations[shop]["label"] == "Blackmarket" then
        if not exports["tq-level"]:checkLevel(3) then
            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Satıcı seni tanımıyor.', 'top-center', 5000)
            break
        end
    end

    local ShopItems = {}
    ShopItems.label = Config.Locations[shop]["label"]
    ShopItems.items = Config.Locations[shop]["products"]
    ShopItems.slots = 30
    TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop_"..shop, ShopItems)
end)
bunu yazacaksın, sonra okokTalkNpc configine gidip yeni bir npc ekleyip
Kod:
        options = {
            {"Siah almak istiyorum", 'xxx:xxx:xxx', 'c'},
        },

options kısmını bunun gibi yapacaksın, o xxx:xxx:xx artık sen ne yazarsan
 
Önce o createThread i sileceksin, sonra
Kod:
RegisterNetEvent('xxx:xxx:xxx', function()
    if Config.Locations[shop]["label"] == "Silahçı" then
        if not exports["tq-level"]:checkLevel(3) then
            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Silahçı seni tanımıyor.', 'top-center', 5000)
            break
        end
    end

    if Config.Locations[shop]["label"] == "Blackmarket" then
        if not exports["tq-level"]:checkLevel(3) then
            exports['h-notif']:send('fas fa-exclamation-circle', 'error', 'Satıcı seni tanımıyor.', 'top-center', 5000)
            break
        end
    end

    local ShopItems = {}
    ShopItems.label = Config.Locations[shop]["label"]
    ShopItems.items = Config.Locations[shop]["products"]
    ShopItems.slots = 30
    TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop_"..shop, ShopItems)
end)
bunu yazacaksın, sonra okokTalkNpc configine gidip yeni bir npc ekleyip
Kod:
        options = {
            {"Siah almak istiyorum", 'xxx:xxx:xxx', 'c'},
        },

options kısmını bunun gibi yapacaksın, o xxx:xxx:xx artık sen ne yazarsan
peki bu silahçı için, bunu lspd market için nasıl yapıcam?
 
bilmem sence ne yapabilirsin, aynı yöntemi deneyeceksin, lspd marketini açan kodu alacaksın gene okokTalknpc configine yeni bir npc ekleyeceksin, onun optionsundaki event bölümüne örneğin "lsp:market-Open:" "c" yazacakısn mesela, kodlar bende yok görmeden bilemem atarsın buraya bakmaya çalışırım müsait oldukça
 
bilmem sence ne yapabilirsin, aynı yöntemi deneyeceksin, lspd marketini açan kodu alacaksın gene okokTalknpc configine yeni bir npc ekleyeceksin, onun optionsundaki event bölümüne örneğin "lsp:market-Open:" "c" yazacakısn mesela, kodlar bende yok görmeden bilemem atarsın buraya bakmaya çalışırım müsait oldukça
Kod:
Citizen.CreateThread(function()
    while true do
        local wait = 1000
        local ped = PlayerPedId()
        local coords = GetEntityCoords(ped)
        for k,v in pairs(Config.Jobs) do
            if PlayerData.job ~= nil then
                if PlayerData.job.name == k then
                    wait = 500
                    local distance = #(coords - vector3(v.Stash.coords.x, v.Stash.coords.y, v.Stash.coords.z))
                    if distance <= 2.3 then
                        wait = 0
                        text = v.Stash.text
                        if distance <= 1.0 then
                            text = "~b~E ~w~- " ..text
                            if IsControlJustPressed(0, 46) then
                                -- stash açma kodu
                                OpenStash(v)
                            end
                        end
                        DrawText3Ds(v.Stash.coords.x, v.Stash.coords.y, v.Stash.coords.z, text)
                    end
                    local distance = #(coords - vector3(v.Shop.coords.x, v.Shop.coords.y, v.Shop.coords.z))
                    if distance <= 2.3 then
                        wait = 0
                        text = v.Shop.text
                        if distance <= 1.0 then
                            text = "~b~E ~w~- " ..text
                            if IsControlJustPressed(0, 46) then
                                -- stash açma kodu
                                OpenMarket(v)
                            end
                        end
                        DrawText3Ds(v.Shop.coords.x, v.Shop.coords.y, v.Shop.coords.z, text)
                    end
                end
            end
        end
        Citizen.Wait(wait)
    end
end)
 
CreateThread i sil,
Kod:
RegisterNetEvent('aaa:bbb:OpenStash', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    for k,v in pairs(Config.Jobs) do
        if PlayerData.job ~= nil then
            if PlayerData.job.name == k then
                local distance = #(coords - vector3(v.Stash.coords.x, v.Stash.coords.y, v.Stash.coords.z))
                if distance <= 5.0 then
                    OpenStash(v)
                end
            end
        end
    end
end)
RegisterNetEvent('aaa:bbb:OpenMarket', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    for k,v in pairs(Config.Jobs) do
        if PlayerData.job ~= nil then
            if PlayerData.job.name == k then
                local distance = #(coords - vector3(v.Shop.coords.x, v.Shop.coords.y, v.Shop.coords.z))
                if distance <= 5.0 then
                    OpenMarket(v)
                end
            end
        end
    end
    OpenMarket(v)
end)

bunları nasıl tetikleyeceğini biliyorsundur umarım? okokTalkNpc de oluşturduğun npclerin options' bölümünden butona basıldığında tetikleteceksin, zaten config.lua' sında anlatıyor olması gerek
 
Son düzenleme:
CreateThread i sil,
Kod:
RegisterNetEvent('aaa:bbb:OpenStash', function()
    OpenStash(v)
end)
RegisterNetEvent('aaa:bbb:OpenMarket', function()
    OpenMarket(v)
end)

bunları nasıl tetikleyeceğini biliyorsundur umarım? okokTalkNpc de oluşturduğun npclerin options' bölümünden butona basıldığında tetikleteceksin, zaten config.lua' sında anlatıyor olması gerek
create threadı silince marketler çalışmayacak ama
 
Merhaba verilen cevaplar doğrultusunda sorununuz çözüdlümü?
 
Merhaba,

Verilen cevap doğrultusunda sorunuz çözüme kavuştu mu?
 
CreateThread i sil,
Kod:
RegisterNetEvent('aaa:bbb:OpenStash', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    for k,v in pairs(Config.Jobs) do
        if PlayerData.job ~= nil then
            if PlayerData.job.name == k then
                local distance = #(coords - vector3(v.Stash.coords.x, v.Stash.coords.y, v.Stash.coords.z))
                if distance <= 5.0 then
                    OpenStash(v)
                end
            end
        end
    end
end)
RegisterNetEvent('aaa:bbb:OpenMarket', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    for k,v in pairs(Config.Jobs) do
        if PlayerData.job ~= nil then
            if PlayerData.job.name == k then
                local distance = #(coords - vector3(v.Shop.coords.x, v.Shop.coords.y, v.Shop.coords.z))
                if distance <= 5.0 then
                    OpenMarket(v)
                end
            end
        end
    end
    OpenMarket(v)
end)

bunları nasıl tetikleyeceğini biliyorsundur umarım? okokTalkNpc de oluşturduğun npclerin options' bölümünden butona basıldığında tetikleteceksin, zaten config.lua' sında anlatıyor olması gerek
peki npcye nasıl polis marketini açmasını sağlayacağım? çünkü police marketi falan configde ayarlı clientte sadece e basma olayı var.
 

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!