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

Wysłany: 2018-04-16, 16:21


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Witam,bo mam taki problem ?e zrobi?em grafike do panelu logowania i za pomoc? dxDrawRectangle zrobi?em te guziki do panelu logowania,przenios?em te? klikni?cie w gui i nadal nie dzia?a.
KOD:
if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
local screenWscreenH guiGetScreenSize()

local blurStrength 20


local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)
        
        dxSetShaderValue(blurShader"ScreenSource"myScreenSource);
        dxSetShaderValue(blurShader"BlurStrength"blurStrength);
        dxSetShaderValue(blurShader"UVSize"screenWidthscreenHeight);

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

addEventHandler("onClientResourceStop"resourceRoot,
function()
    if (blurShaderthen
        destroyElement(blurShader)
        blurShader nil
    end
end)

x,y=2313.581282.80-- my width
intro_step=math.random(0,850)

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end
local dist 100
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(90 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function roundedRectangle(xywhcolor)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(2h41colorfalse)
  dxDrawRectangle(1214colorfalse)
  dxDrawRectangle(w214colorfalse)
end
 


function renderLoginBox()
    blur true
    dxDrawText("U?ytkownik"sx*280/1024sy*270/768sx*760/1024sy*302/768white1.30"default-bold""center""center"false)
    dxDrawText("Has?o"sx*-240/1024sy*480/768sx*1280/1024sy*302/768white1.30"default-bold""center""center"false)
        dxDrawText("Zaloguj si?"sx*685/2024sy*1015/1200sx*230/2504sy*45/768white1.00"default-bold""center""center"false)
    dxDrawText("Zarejestruj si?"sx*1140/784sy*1013/1200sx*130/1024sy*45/768white1.00"default-bold""center""center"false) 
        dxDrawImage(2001811280600"siema.png"000tocolor(255255255255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"siema.png"angle0, -120 )
        dxDrawText("Aktuliazcje"270348504381tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Regulamin"12193461439392tocolor(255255255255), 1.00"pricedown""left""top"falsefalsetruefalsefalse)
        dxDrawRectangle(73152515962tocolor(242540255), true)
        dxDrawText("Zaloguj sie"782547900577tocolor(255255255255), 1.00"default""left""top"falsefalsetruefalsefalse)
        dxDrawRectangle(73160615952tocolor(242540255), true)
        dxDrawText("Zarejestruj sie"772616831663tocolor(255255255255), 1.00"default""left""top"falsefalsetruefalsefalse)
    local x,y=getPointFromDistanceRotation(2313.581282.80distangler)
    setCameraMatrix(x,y,107.72+0.9,2323.691285.66107.72+0.9)
    angler=(angler+0.1)
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*731/2524sy*525/1188sx*159/1024sy*62/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Wype?nij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*731/2544sy*606/1188sx*159/1024sy*768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                data.info="Login/Has?o musz? mie? mniej ni? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        -- Usuwamy elementy
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    setPlayerHudComponentVisible("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1]=guiCreateEdit(0.400.400.220.04""true)
    data.button[2]=guiCreateEdit(0.400.530.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-16, 16:47


Cobey







Wiek: 25
Na forum: 3302 dni
Posty: 86
Nick w MP: Anonimowa

Piwa: 285

Respekt: -9

Ostrzeżeń: 100%
wpierw musisz wyskalowa?,bez skalowania nie zadziala ci to
dodaj na samej g?rze:

local sx,sy = guiGetScreenSize()
local px,py = (sx/1366),(sy/768)
gdy to dodasz,to do ka?dego kodu dodaj:
*px*py*px*py
dxDrawText("Zarejestruj sie", 772, 616, 831, 663, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false)


czyli po dodaniu:
dxDrawText("Zarejestruj sie", 772*px, 616*py, 831*px, 663*py, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false)

Podpis
13.04.2018 [*] ArtWorld
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Rumper
Wysłany: 2018-04-16, 17:07


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Linijka 96 oraz 105 to linijki w kt?rych ustawiasz po?o?enie opcji zaloguj i zarejestruj.

Powinno dzia?a?.

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(73152515962) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Wype?nij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(73160615952) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                data.info="Login/Has?o musz? mie? mniej ni? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)


Dodam tylko, ?e na Twojej rozdzielczo?ci w kt?rej grasz w MTA b?dzie ten przycisk, a na innych mniejszych lub wi?kszych b?dzie si? gdzie? indziej znajdowa?, oraz by? mo?e (r?wnie? w zale?no?ci od rozdzielczo?ci ekranu gracza) nie b?d? sprawnie dzia?a?y te dwie opcje, dlatego musisz wyskalowa? te przyciski (dxDrawRectangle) jak i napisy (dxDrawText), aby ka?dy gracz na Twoim serwerze nie mia? problem?w z panelem logowania.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Rumper
Wysłany: 2018-04-16, 17:09


Cobey







Wiek: 25
Na forum: 3302 dni
Posty: 86
Nick w MP: Anonimowa

Piwa: 285

Respekt: -9

Ostrzeżeń: 100%
Kalizman, o tym m?wi?,najlepiej wyskalowa? wszystko;p

Podpis
13.04.2018 [*] ArtWorld
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-16, 21:09


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Dzi?ki wielkie , lec? :piwo: dla was
Do zamkni?cia

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Tagi: panel :: logowania
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