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

Wysłany: 2016-02-16, 19:06


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

Czy te linijki odpowiadaja za buttona?
function clientClicking btnstatex)
    if ( btn == 'left' and not guiGetVisible window ) and state == 'down' and isOpen then
        if ( >=  pY+370 and <=  pY+370 then
            local userpass guiGetText username ), guiGetText password )
            -- Login Button --
            if ( >= pX+25 and <= pX+440then
                if ( string.gsub user' ''' ) ~= '' and string.gsub pass' ''' ) ~= '' then
                    if ( string.find user'%s' ) ) then
                        return sendError "Spaces (' ') are not allowed\nin the username." )
                    end if ( string.find pass'%s' ) ) then
                        return sendError "Spaces (' ') are not allowed\nin the password." )
                    end
                    triggerServerEvent "Login:onClientAttemptLogin"localPlayeruserpass )
                else
                    sendError "A username and password are\nrequired to access the server." )
                end


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 19:25


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

    if ( btn == 'left' and not guiGetVisible window ) and state == 'down' and isOpen then


Tak za bindkey

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 19:27


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

Chodzi mi o to be mam napis, ale jak najade kursorem na napis to nic nie pokazuje, button jest gdzie indziej, jak to poprawi?? dac ca?yego c-sida?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 20:01


mlodasnygo







Wiek: 16
Na forum: 3972 dni
Posty: 205

Piwa: 518

Respekt: 161,8
Respekt: 161,8Respekt: 161,8

Tak pokaz ;)

Podpis
600 dni - 10 marca 2017
:piwo: 500 piw :piwo: - 10 marca 2017
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-17, 11:02


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50


local enableGuest false;

local sxsy guiGetScreenSize ( )
local pXpY = ( sx 485 ), ( sy 720 )
local username guiCreateEdit(pX+180pY+30028833""false)
guiSetVisible usernamefalse )
local password guiCreateEdit(pX+180pY+36028833""false)
guiSetVisible passwordfalse )
guiEditSetMasked(passwordtrue)
local window guiCreateWindow( ( sx 300 ), ( sy 208 ), 266208"Login Panel Message"false)
guiWindowSetMovable(windowfalse)
guiWindowSetSizable(windowfalse)
guiSetVisible windowfalse )
guiSetAlpha window)
local exitBtn guiCreateButton(15516210136"Exit"falsewindow)
local infoLbl guiCreateLabel(1826228130"Message"falsewindow)
local isOpen false;
local isLoggedin false;
local data = {
    login = {
        hovering false,
        alphaMode false,
        loginTextAlpha 235,
        colors = { 255255255 }
    },
    reg = {
        hovering false,
        alphaMode false,
        loginTextAlpha 235,
        colors = { 255255255 }
    },
    guest = {
        hovering false,
        alphaMode false,
        loginTextAlpha 235,
        colors = { 255255255 }
    }
}
function dxDrawLoginPanel( )
    -- default: 350266
    if ( isOpen then
        dxDrawRectangle(pXpY490720tocolor(25525525550), false)
        dxDrawText("Life Stories v0.5"pXpY870314tocolor(255255255255), 1.50"bankgothic""center""top"falsefalsefalsefalsefalse)
        dxDrawLine(pXpY+48pX+485pY+48tocolor(255255255255), 1false)
        dxDrawText("Nick:"pX+40pY+300506368tocolor(255255255255), 1"bankgothic""left""top"falsefalsefalsefalsefalse)
        dxDrawText("Has?o:"pX+40pY+360506428tocolor(255255255255), 1"bankgothic""left""top"falsefalsefalsefalsefalse)
        dxDrawLine(pXpY+405pX+485pY+405tocolor(255255255255), 1false)

        local rgunpack data.login.colors )
        dxDrawText("Zaloguj"pX+25pY+440600468tocolorrgbdata.login.loginTextAlpha), 1.00"bankgothic""left""top"falsefalsefalsefalsefalse)
        local rgunpack data.reg.colors )
        dxDrawText("Zarejestruj"pX+260pY+440794468tocolor(rgbdata.reg.loginTextAlpha), 1.00"bankgothic""left""top"falsefalsefalsefalsefalse)
        
        if ( enableGuest then
            local rgunpack data.guest.colors )
            dxDrawText("Go??"pX+40pY+167600468tocolorrgbdata.guest.loginTextAlpha), 1.00"bankgothic""left""top"falsefalsefalsefalsefalse)
            dxDrawLine(pX+155pY+168pX+155pY+168+34tocolor(255255255255), 1false)
        end
        
        -- give fade effect
        if ( data.login.hovering then
            data.login.colors = { 255140}
            local alpha data.login.loginTextAlpha
            if ( not data.login.alphaMode then
                data.login.loginTextAlpha alpha 5
                if ( data.login.loginTextAlpha <= 50 then
                    data.login.alphaMode true
                end
            else
                data.login.loginTextAlpha alpha 5
                if ( data.login.loginTextAlpha >= 235 then
                    data.login.alphaMode false
                end
            end
        elseif ( data.reg.hovering then
            data.reg.colors = { 255140}
            local alpha data.reg.loginTextAlpha
            if ( not data.reg.alphaMode then
                data.reg.loginTextAlpha alpha 5
                if ( data.reg.loginTextAlpha <= 50 then
                    data.reg.alphaMode true
                end
            else
                data.reg.loginTextAlpha alpha 5
                if ( data.reg.loginTextAlpha >= 235 then
                    data.reg.alphaMode false
                end
            end
        elseif ( data.guest.hovering then
            data.guest.colors = { 255140}
            local alpha data.guest.loginTextAlpha
            if ( not data.guest.alphaMode then
                data.guest.loginTextAlpha alpha 5
                if ( data.guest.loginTextAlpha <= 50 then
                    data.guest.alphaMode true
                end
            else
                data.guest.loginTextAlpha alpha 5
                if ( data.guest.loginTextAlpha >= 235 then
                    data.guest.alphaMode false
                end
            end
        else
            data.login.loginTextAlpha 235
            data.guest.loginTextAlpha 235
            data.reg.loginTextAlpha 235
            data.login.colors = { 255255255 }
            data.guest.colors = { 255255255 }
            data.reg.colors = { 255255255 }
        end
    end
end

function cursorMove __x)
    if ( isCursorShowing ( ) and not guiGetVisible window ) and isOpenthen
        if ( >=  pY+170 and <=  pY+200 then
            if ( >= pX+161 and <= pX+251 then
                data.login.hovering true
                return
            elseif ( >= pX+305 and <= pX+445 then
                data.reg.hovering true
                return
            elseif ( >= pX+40 and <= pX+135 then
                data.guest.hovering true
                return
            end
        end
    end
    data.login.hovering false
    data.reg.hovering false
    data.guest.hovering false
end

function openLogin ( )
    addEventHandler "onClientPreRender"rootdxDrawLoginPanel )
    addEventHandler 'onClientCursorMove'rootcursorMove )
    addEventHandler "onClientClick"rootclientClicking )
    guiSetInputMode "no_binds_when_editing" )
    guiSetVisible passwordtrue )
    guiSetVisible usernametrue )
    showCursor true )
    addEventHandler 'onClientGUIClick'rootclientClosingErrorWindowEvent )
    isOpen true
    showChat(false)
    showPlayerHudComponent 'all'false )
end
addEvent "onClientPlayerLogout"true )
addEventHandler 'onClientPlayerLogout'rootopenLogin )

function closeLogin ( )
    removeEventHandler "onClientPreRender"rootdxDrawLoginPanel )
    removeEventHandler 'onClientCursorMove'rootcursorMove )
    removeEventHandler "onClientClick"rootclientClicking )
    guiSetVisible passwordfalse )
    guiSetVisible usernamefalse )
    showCursor false )
    removeEventHandler 'onClientGUIClick'rootclientClosingErrorWindowEvent )
    guiSetVisible windowfalse )
    isOpen false
    isLoggedin true
    showChat(true)
    showPlayerHudComponent 'all'true )
end
addEvent "onClientPlayerLogin"true )
addEventHandler "onClientPlayerLogin"rootcloseLogin )

function sendError msg )
    if ( not guiGetVisible window ) ) then
        guiSetVisible windowtrue )
        guiSetText infoLblmsg )
        guiBringToFront window )
    end
end
addEvent "onPlayerLoginPanelError"true )
addEventHandler "onPlayerLoginPanelError"rootsendError )

function clientClicking btnstatex)
    if ( btn == 'left' and not guiGetVisible window ) and state == 'down' and isOpen then
        if ( >=  pY+170 and <=  pY+200 then
            local userpass guiGetText username ), guiGetText password )
            -- Login Button --
            if ( >= pX+156 and <= pX+246 then
                if ( string.gsub user' ''' ) ~= '' and string.gsub pass' ''' ) ~= '' then
                    if ( string.find user'%s' ) ) then
                        return sendError "Spaces (' ') are not allowed\nin the username." )
                    end if ( string.find pass'%s' ) ) then
                        return sendError "Spaces (' ') are not allowed\nin the password." )
                    end
                    triggerServerEvent "Login:onClientAttemptLogin"localPlayeruserpass )
                else
                    sendError "A username and password are\nrequired to access the server." )
                end

            -- register button
            elseif ( >= pX+300 and <= pX+440 then
                if ( string.gsub user' ''' ) ~= '' and string.gsub pass' ''' ) ~= '' then
                    if ( string.find user'%s' ) ) then
                        return sendError "Spaces are not allowed\nin the username." )
                    end if ( string.find pass'%s' ) ) then
                        return sendError "Spaces are not allowed\nin the password." )
                    end if ( string.len user ) < then
                        return sendError "You're username must be at\nleast 5 characters long." )
                    end if ( string.len pass ) < then
                        return sendError "You're password must be at\nleast 6 characters long." )
                    end
                    triggerServerEvent "Login:onClientAttemptRegistration"localPlayeruserpass )
                else
                    sendError "A username and password are\nrequired to access the server." )
                end
                
            -- play as guest
            elseif ( >= pX+40 and <= pX+135 then
                closeLogin ( )
                triggerServerEvent "Login:doClientGuestLogin"localPlayer )
            end
        end
    end
end

function clientClosingErrorWindowEvent( )
    if ( source == exitBtn then
        guiSetVisible windowfalse )
    end
end

function isClientLoggedin ( )
    return isLoggedin
end

setTimer ( function ( )
    openLogin ( )
end700)


[ Dodano: 2016-02-17, 12:34 ]
Jest tu ten button?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-17, 13:45


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Te linijki kt?re poda?e? w 1-po?cie odpowiadaj? za klikni?cie w kt?ry? button.

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-17, 14:40


Axmell

E-Commerce






Wiek: 24
Na forum: 3810 dni
Posty: 279
Nick w MP: %Axmell

Piwa: 224

Respekt: 50

Jurandovsky, Bo mam taki problem ze mam niewidzialny przycisk, gdzie on tu jest?

[ Dodano: 2016-02-17, 16:58 ]
Pomo?ecie?? ??

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-17, 19:14


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

function clientClicking btnstatex)
    if ( btn == 'left' and not guiGetVisible window ) and state == 'down' and isOpen then
        if ( >=  pY+170 and <=  pY+200 then
            -- Login Button --
            if ( >= pX+156 and <= pX+246 then

            -- register button
            elseif ( >= pX+300 and <= pX+440 then

            -- play as guest
            elseif ( >= pX+40 and <= pX+135 then


Przycisk?w nie ma. Funkcja onClientClick pobiera x,y z ekranu i je?eli naci?niesz w odpowiednim miejscu to ci? zaloguje,zarejestruje.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: button
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