Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-02-26, 11:29


Xrent

-






Wiek: 22
Na forum: 3188 dni
Posty: 230
Nick w MP: Pazdam

Piwa: 535

Respekt: 295,3
Respekt: 295,3Respekt: 295,3Respekt: 295,3

Ostrzeżeń: 60%
Witam, mam skrypt na dashboard i chc? by brzmia? on tak:

1. Skaluj? gui. - mam
2. Nadaj? if z e dat? na gui i razem daje enda. - mam
3. gui po wej?ciu na serw jest wy??czone. - nie mam
4. Po naci?ni?ciu taba si? w??cza. A jak ponownie naci?nie taba to usuwa. - nie mam
Nie wiem jak? da? kolejno?? jak co? mo?ecie pom?c stawiam :piwo: i R*
mojeW,mojeH = 1600, 900
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)
skalaX = (sW/mojeW)
skalaY = (sH/mojeH)    

addEventHandler("onClientRender", root, function()
    if isPlayerMapVisible() then return end
    
    -- chowa elementy hudu z gta.
        showPlayerHudComponent("clock", false)
    showPlayerHudComponent("health", false)
    showPlayerHudComponent("money", false)
    showPlayerHudComponent("armour", false)
    showPlayerHudComponent("weapon", false)
    showPlayerHudComponent("ammo", false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)
    -- tworzy zaokr?glenie okna(rectangle) --    
    function roundedRectangle(x, y, w, h, color)
    dxDrawRectangle(x, y, w, h, color, false)
    dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
    dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
    dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
    dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end
     roundedRectangle(555*w, 165*h, 409*w, 49*h, tocolor(255, 0, 255, 255), false)
     roundedRectangle( 555*w, 214*h, 409*w, 560*h, tocolor(0, 0, 0, 78), false)
         if getElementData(localPlayer, "dashboard") then end
end)


[ Dodano: 2018-02-26, 11:39 ]
Takie co? robi?em na tele i nie testowa?em wi?c nwm czy zadzia?a pewnie za ma?o end?w i ten event w z?ym miejscu. Gui ma e date dashboard no i zrobi?em tak po wej?ciu gracza na serw daje setEdate na false no i wtedy gui mu nie pokazuje. Ale pytanie jak zrobi? by po klikni?ciu taba w??cza?o mu si? gui i po ponownym klikni?ciu wy??cza?o wiem bindKey ale co dalej :)

mojeW,mojeH = 1600, 900
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)
skalaX = (sW/mojeW)
skalaY = (sH/mojeH)    

addEventHandler("onClientRender", root, function()
    if isPlayerMapVisible() then return end
    
    -- chowa elementy hudu z gta.
    showPlayerHudComponent("clock", false)
    showPlayerHudComponent("health", false)
    showPlayerHudComponent("money", false)
    showPlayerHudComponent("armour", false)
    showPlayerHudComponent("weapon", false)
    showPlayerHudComponent("ammo", false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)
    -- tworzy zaokr?glenie okna(rectangle) --    
    addEventHandler ( "onClientPlayerJoin", getRootElement(),
    function roundedRectangle(x, y, w, h, color)
    setElementData(localPlayer, "dashboard",false)
    dxDrawRectangle(x, y, w, h, color, false)
    dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
    dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
    dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
    dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end
     roundedRectangle(555*w, 165*h, 409*w, 49*h, tocolor(255, 0, 255, 255), false)
     roundedRectangle( 555*w, 214*h, 409*w, 560*h, tocolor(0, 0, 0, 78), false)
         if getElementData(localPlayer, "dashboard") then end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-26, 15:27


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

mojeW,mojeH = 1600, 900
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)
skalaX = (sW/mojeW)
skalaY = (sH/mojeH)    

local dash = false

function board()
    if isPlayerMapVisible() then return end
    if getElementData(localPlayer, "dashboard") then end
    
    -- chowa elementy hudu z gta.
        showPlayerHudComponent("clock", false)
    showPlayerHudComponent("health", false)
    showPlayerHudComponent("money", false)
    showPlayerHudComponent("armour", false)
    showPlayerHudComponent("weapon", false)
    showPlayerHudComponent("ammo", false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)

    roundedRectangle(555*w, 165*h, 409*w, 49*h, tocolor(255, 0, 255, 255), false)
    roundedRectangle( 555*w, 214*h, 409*w, 560*h, tocolor(0, 0, 0, 78), false)
end

function roundedRectangle(x, y, w, h, color)
    dxDrawRectangle(x, y, w, h, color, false)
    dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
    dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
    dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
    dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end

bindKey("tab", "down", function()
    if dash == true then
        dash = false
        if not getElementData(localPlayer,"e-data czy jest zalogowany") then return end
        removeEventHandler("onClientRender", root, board)
        showCursor(false)
        showChat(true)
        setElementData(localPlayer, "dashboard", false)
    else
        if not getElementData(localPlayer,"e-data czy jest zalogowany") then return end
        dash = true
        showCursor(true)
        showChat(false)
        setElementData(localPlayer, "dashboard", true)
        addEventHandler("onClientRender", root, board)
    end
end)


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Tagi: dashboard
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku