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 cok kolaydi nui

no name olmama gerek yok komik komik yazışmalar yaşıyosunuz yok adama satın al öyle göstereyim falan manyak mısınız oglum işte patlatmış adam seni git bari öğret forsun olsun
 
basit bi adamsın paylaştığım kodlarla yapabilirsiin arkadaşlar bu köylü arkadaş yerinde saysın
 
Arkadaşlar tabletten olabildiğince yapmaya çalıştım güle güle kullanın :)

Kod:
local Keys = {
    ["E"] = 38, -- E tuşunun tuş kodu
    -- Diğer tuşlar için gerektiğinde benzer şekilde tanımlamalar yapabilirsiniz
}

local nuiVisible = false

local function FindClosestDoor()
    local playerPed = PlayerPedId()
    local playerCoords = GetEntityCoords(playerPed)
    local closestDoor = nil
    local closestDistance = -1

    -- Tüm kapıları al
    local doors = exports["qb-doorlock"]:GetDoors()

    for _, door in ipairs(doors) do
        local doorCoords = door["objCoords"]

        -- İki nokta arasındaki mesafeyi hesapla
        local distance = #(playerCoords - doorCoords)

        -- En yakın kapıyı güncelle
        if closestDoor == nil or distance < closestDistance then
            closestDoor = door
            closestDistance = distance
        end
    end

    return closestDoor
end

local function drawText(text, key, icon)
    if type(key) ~= "string" then
        key = "E"
        local closestDoor = FindClosestDoor() -- FindClosestDoor fonksiyonunu çağır ve closestDoor değişkenine atayın
        if closestDoor ~= nil and closestDoor.data.locked then
            icon = "locked_icon.png"
        else
            icon = "unlocked_icon.png"
        end
    end

    SendReactMessage("DRAW_TEXT", {
        text = text,
        key = key,
        icon = icon
    })
end

local function hideNUIText()
    SendNUIMessage({
        type = "setDoorText",
        enable = false
    })
end

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
       
        if IsControlJustPressed(0, Keys["E"]) then
            if not nuiVisible then
                TriggerEvent('qb-core:client:DrawText', 'Kapıyı Aç', 'E')
                nuiVisible = true
            else
                TriggerEvent('qb-core:client:HideText')
                nuiVisible = false
            end
        end
    end
end)

RegisterNetEvent('qb-core:client:DrawText')
AddEventHandler('qb-core:client:DrawText', function(text, key, icon)
    drawText(text, key, icon)
end)

RegisterNetEvent('qb-core:client:HideText')
AddEventHandler('qb-core:client:HideText', function()
    hideNUIText()
end)
 
Evde degilim eve gecince bastan sona tum kodlari paylasirim satin almaniza gerek yok beles seyi 😆
 
🤦‍♂️🤦‍♂️🤦‍♂️🤷‍♂️🤷‍♂️🤷‍♂️
 
UI Text kullanmak için örnek bir kod;

C#:
local inZone1 = false
Citizen.CreateThread(function()
    while true do
        local sleep = 750
        if pLoaded then
            local playercoords = GetEntityCoords(PlayerPedId())
            for val, coords in pairs(Config.USNGCoords) do
                local distance = GetDistanceBetweenCoords(playercoords.x, playercoords.y, playercoords.z, coords.x, coords.y, coords.z, true)
                local distance2 = Vdist(playercoords.x, playercoords.y, playercoords.z, coords.x, coords.y, coords.z)
                if PlayerData.job ~= nil then
                    if PlayerData.job.name == "usng" then
                        if distance2 < 7 then
                            sleep = 5
                            DrawMarker(2, coords.x, coords.y, coords.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 0.4, 0.2, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0)
                            if distance < 2 then
                                inZone1 = true
                                -- QBCore.Functions.DrawText3D(coords.x, coords.y, coords.z, '~r~[E]~s~ - Depo')
                                if IsControlJustPressed(0, 38) then
                                    usngmenu()
                                end
                            else
                                inZone1 = false
                            end
                            if inZone1 then
                                exports['nUi']:DrawText("ÇIKACAK YAZI", "TUŞ", "İKON")
                            end
                            if not inZone1 then
                                exports['nUi']:HideText()
                            end
                        end
                    end
                end
            end
        end
        Citizen.Wait(sleep)
    end
end)

İnput için örnek kod scriptin input.lua kısmının içinde bir komut ile deaktif bir şekilde duruyor input kullanmak isterseniz o kodları uygulayabilirsiniz

Menü kısmını kullanmak içinse örnek kod aşşağıda bulunuyor;

PHP:
RegisterCommand('kolaydinuitest', function()
    exports['nUi']:openMenu({
        {
            header = 'QBCore Test Menu',
            icon = 'fas fa-code',
            isMenuHeader = true, -- Set to true to make a nonclickable title
        },
        {
            header = 'First Button',
            txt = 'Print a message!',
            icon = 'fas fa-code-merge',
            params = {
                event = 'paravermeyin-aga-beles-kod31',
                args = {
            message = 'This was called by clicking a button'
                }
            }
        },
        {
            header = 'Second Button',
            txt = 'Open a secondary menu!',
            icon = 'fas fa-code-pull-request',
            -- disabled = false, -- optional, non-clickable and grey scale
            -- hidden = true, -- optional, hides the button completely
            params = {
                -- isServer = false, -- optional, specify event type
                event = 'ahbeabibelesekodverdikya',
                args = {
                    number = 2,
                }
            }
        },
    })
end)

RegisterNetEvent('ahbeabibelesekodverdikya', function(data)
    local number = data.number
    exports['nUi']:openMenu({
        {
            header = 'Return to main menu',
            icon = 'fa-solid fa-backward',
            params = {
                event = 'paravermeyin-aga-beles-kod',
                args = {}
            }
        },
        {
            header = 'Sub-menu button',
            txt = 'Print a message!',
            icon = 'fas fa-code-merge',
            params = {
                event = 'paravermeyin-aga-beles-kod31',
                args = {
            message = 'This was called by clicking a button'
                }
            }
        }
    })
end)

RegisterNetEvent('paravermeyin-aga-beles-kod', function()
    ExecuteCommand('kolaydinuitest')
end)

RegisterNetEvent('paravermeyin-aga-beles-kod31', function(data)
    print(data.message)
end)

Status text kısmının örnek koduda scriptin içinde bulunuyor onu uygulayabilirsiniz kullanmak istediğiniz scriptlere

Progressbar kısmı ya hatalı yada ben yapamadım abimiz parayla satmazsa kodu paylasirsa kullanirsiniz
 

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!