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

Yardım Fivem NUI Yardım

mindseth

Üye
FT Kullanıcı
Katılım
2 yıl 1 ay 18 gün
Mesajlar
17
Discord
mindset#0001
HTML:
<html>
    <head>
        <link rel="stylesheet" href="reset.css" type="text/css">
        <link rel="stylesheet" href="style.css" type="text/css">
        <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
        <script src="./listener.js" type="text/javascript"></script>
    </head>
        <body>
            <div id="container">
                <h1> mindset panel </h1>
            </div>
        </body>
</html>

HTML NUI

JavaScript:
$(function(){
    window.onload = (e) => {
        window.addEventListener('message', (event) => {
            var item = event.data;
            if (item !== undefined && item.type === "ui") {
                if (item.display === false) {
                    $("#container").show();
                } else{
                    $("#container").hide();
                }
            }
        });
    };
});

CSS:
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

CSS:
/* This applies to all elements (bad practice) */
* {
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

/* This css centers at the middle of the screen */
#container {
    padding: 10px;
    text-shadow: 2px 2px 5px #424242;
    position: absolute;
    color: rgb(241, 235, 235);
    top: 47%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 45px;
    text-align: center;
    background-color: #272727;
    border-radius: 25px;
    border: 2px solid #dad9d9 ;
}

.small {
    font-size: 25px;
}

Kod:
    local display = false
   function alert(msg)
        SetTextComponentFormat("STRING")
        AddTextComponentString(msg)
        DisplayHelpTextFromStringLabel(0, 0, 1, -1)
    end
    Citizen.CreateThread(function()
        local ad_key = 315
        while true do
            Citizen.Wait(1)
            if IsControlJustReleased(1, ad_key) then
                TriggerEvent('nui:on', true)
                -- alert("~b~Admin Menü Açıldı Tuş: ~INPUT_REPLAY_FOVDECREASE~")   
            end
        end
    end)
    Citizen.CreateThread(function()
        local ad_key = 315
        while true do
            Citizen.Wait(1)
            if IsControlJustReleased(1, ad_key) then
                TriggerEvent('nui:on', false)
              --  alert("~b~Admin Menü Açıldı Tuş: ~INPUT_REPLAY_FOVDECREASE~")   
            end
        end
    end)
    RegisterNetEvent('nui:on')
    AddEventHandler('nui:on', function()
      SendNUIMessage({
        type = "ui",
        display = true
      })
    end)
 
    RegisterNetEvent('nui:off')
    AddEventHandler('nui:off', function()
      SendNUIMessage({
        type = "ui",
        display = false
      })
    end)

Normalde NUI yı tuşa bastıktan sonra açması ve tekrar bastığımda kapatması gerek fakat bassamda basmasamda ekranın ortasında kalıyor yardımcı olurmusunuz discord mindset#8257

Ekli dosyayı görüntüle 72166

aynen böyle
 
DF
HTML:
<html>
    <head>
        <link rel="stylesheet" href="reset.css" type="text/css">
        <link rel="stylesheet" href="style.css" type="text/css">
        <script src="nui://game/ui/jquery.js" type="text/javascript"></script>
        <script src="./listener.js" type="text/javascript"></script>
    </head>
        <body>
            <div id="container">
                <h1> mindset panel </h1>
            </div>
        </body>
</html>

HTML NUI

JavaScript:
$(function(){
    window.onload = (e) => {
        window.addEventListener('message', (event) => {
            var item = event.data;
            if (item !== undefined && item.type === "ui") {
                if (item.display === false) {
                    $("#container").show();
                } else{
                    $("#container").hide();
                }
            }
        });
    };
});

CSS:
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

CSS:
/* This applies to all elements (bad practice) */
* {
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

/* This css centers at the middle of the screen */
#container {
    padding: 10px;
    text-shadow: 2px 2px 5px #424242;
    position: absolute;
    color: rgb(241, 235, 235);
    top: 47%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 45px;
    text-align: center;
    background-color: #272727;
    border-radius: 25px;
    border: 2px solid #dad9d9 ;
}

.small {
    font-size: 25px;
}

Kod:
    local display = false
   function alert(msg)
        SetTextComponentFormat("STRING")
        AddTextComponentString(msg)
        DisplayHelpTextFromStringLabel(0, 0, 1, -1)
    end
    Citizen.CreateThread(function()
        local ad_key = 315
        while true do
            Citizen.Wait(1)
            if IsControlJustReleased(1, ad_key) then
                TriggerEvent('nui:on', true)
                -- alert("~b~Admin Menü Açıldı Tuş: ~INPUT_REPLAY_FOVDECREASE~") 
            end
        end
    end)
    Citizen.CreateThread(function()
        local ad_key = 315
        while true do
            Citizen.Wait(1)
            if IsControlJustReleased(1, ad_key) then
                TriggerEvent('nui:on', false)
              --  alert("~b~Admin Menü Açıldı Tuş: ~INPUT_REPLAY_FOVDECREASE~") 
            end
        end
    end)
    RegisterNetEvent('nui:on')
    AddEventHandler('nui:on', function()
      SendNUIMessage({
        type = "ui",
        display = true
      })
    end)

    RegisterNetEvent('nui:off')
    AddEventHandler('nui:off', function()
      SendNUIMessage({
        type = "ui",
        display = false
      })
    end)

Normalde NUI yı tuşa bastıktan sonra açması ve tekrar bastığımda kapatması gerek fakat bassamda basmasamda ekranın ortasında kalıyor yardımcı olurmusunuz discord mindset#8257

Ekli dosyayı görüntüle 72166

aynen böyle
nui: off u hiçbir yerde triggerlamiyorsun. Senin denedigin nui: on a true veya false göndermek ama bunu nui: on da belirtmemissin.
yani :
Kod:
 RegisterNetEvent('nui:on')
    AddEventHandler('nui:on', function(state)
      SendNUIMessage({
        type = "ui",
        display = state
      })
    end)

tarzinda birsey yapman gerek true veya false göndermek istiyorsan.
 
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!