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

Wysłany: 2018-03-25, 22:46


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 przerabiam panel logowania i jak klikam na gui kt?re mam to sie nie loguje tylko jest na starym miejsu a zmieni?em tak jak strzeba.
Jak by kto? m?g? poprowi? mnie.
Za pomoc daje R* :piwo:
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
    dxDrawRectangle(44988066tocolor(255255255255), false)
        dxDrawLine(screenW 1.0000screenH 0.6111screenW 1.0000, (screenH 0.3156) - 1tocolor(1400255255), 6false)
    if data.info then dxDrawText(data.infosx*252/1024sy*272/768sx*800/1024sy*255/768tocolor(1400255255), 2.00"default""center""center"falseend     
    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)
    if not isMouseIn(sx*520sy*280sx*200sy*200then roundedRectangle(sx*305/2524sy*506/1188sx*200/1024sy*45/768tocolor(1405255170), false)
    else roundedRectangle(sx*305/2524sy*506/1188sx*200/1024sy*45/768tocolor(1405255100), falseend
    if not isMouseIn(sx*520sy*380sx*200sy*200then roundedRectangle(sx*535/764sy*506/1200sx*200/1024sy*45/768tocolor(1405255170), false)
    else roundedRectangle(sx*535/764sy*506/1200sx*200/1024sy*45/768tocolor(1405255100), falseend
       dxDrawImage(0.10.11300800"logo.png"000tocolor(255255255255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"logo.png"angle0, -120 )
         dxDrawImage(520280200200"zalogujsie.png"000tocolor(255255255255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"zalogujsie.png"angle0, -120 )
         dxDrawImage(520380200200"zarejestruj.png"000tocolor(255255255255), false)
    --dxDrawImage(sw/2-295,sh/2+70,594,307,"zarejestruj.png"angle0, -120 )
    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*520sy*280sx*200sy*200) 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*520sy*380sx*200sy*200) 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)
    showPlayerHudComponent("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.380.400.220.04""true)
    data.button[2]=guiCreateEdit(0.380.530.220.04""true)   
    guiEditSetMasked(data.button[2],true)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-26, 10:32


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

u?yj dxDrawRectangle i zaznacz miejsce logowania. Potem przepisz tzw. kordy i wpisz w isMouseIn

        if isMouseIn(sx*520sy*280sx*200sy*200) and data.showed then

Jest opcja ?e mo?e masz ni?ej albo wy?ej dlatego zr?b tak jak napisa?em wy?ej

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Rumper
Wysłany: 2018-03-26, 16:12


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%
By? m?g? poda? zmieniony kod? bo jako? ja tak robie i mi nie dzia?a ;x

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-26, 16:45


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

w??cz guieditor potem zaznacz dxDrawRectangle gdzie ma by? logowanie potem ppm out co? tam gdzie masz te zapisy kord?w i podmie?.


Dam ci ma?? podpowied?
pod ten przycisk triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
jest logowanie, a pod rejestracje triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
da?em ci ?atwiej ?eby? wiedzia? gdzie trafi? ten przycsk to triggerServerEvent gdzie masz isMouseIn

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-26, 17:49


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%
Zrobi?em i nadal nie dzia?a

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

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