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

Wysłany: 2014-11-23, 12:53


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Usu? event onClientResourceStart przy tworzeniu gui, jest zb?dny.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 15:32


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

ehh teraz mi takie b??dy daje :p i wg si? nie w?acza ten panel ;( mam do??


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 19:47


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Poka? kod.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 20:10


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

Nie mam teraz dost?pu do kompa lecz jest on taki sam jak mi napisa?e? i to co kaza?e? usun??. . Jutro podam kod

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 22:51


dudeks







Wiek: 32
Na forum: 6717 dni
Posty: 171

Piwa: 89

Respekt: 105,3
Respekt: 105,3

Zamiast GUIEditor_Button to GUIEditor.Button
Kropka (.), a pod?oga (_) chyba si? r??ni, nie s?dzisz? :)

I tego eventu nie usuwaj, bez niego przecie? GUI Ci si? nie utworzy, co nast?pnie kod w funkcji windowHandler b?dzie Ci zwraca? nil co do elementu okienka. W kodzie musisz r?wnie? poprawi? zmienne, te nie zdefiniowane, np.: LoginUsername, EditRegisterUsername.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-23, 23:19


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

dudeks, co mu si? nie otworzy? Robi? tym sposobem GUI od 2 lat i nie widz? b??du.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-24, 15:54


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

Dudeks nic to nie da i b?dzie wywala? wi?cej b?ed?w bo to by?o robione w guied wi?c to chyba si? nie myli ;p dobra podam wszystkie kody ;-)
c-side


GUIEditor = {
    button = {},
    window = {},
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(0, 221, 1366, 302, "Witamy Na Serwerze RPG (PL)", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.edit[1] = guiCreateEdit(799, 44, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[1] = guiCreateButton(1059, 45, 150, 103, "Akceptuje", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(676, 46, 123, 44, "Login", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF020578")
        GUIEditor.edit[2] = guiCreateEdit(799, 44, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.edit[3] = guiCreateEdit(799, 92, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(678, 92, 121, 46, "Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF790000")
        GUIEditor.edit[4] = guiCreateEdit(57, 46, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.edit[5] = guiCreateEdit(57, 102, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.edit[6] = guiCreateEdit(57, 158, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(302, 46, 128, 46, "Nick/Nazwa", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF030D53")
        GUIEditor.button[5] = guiCreateButton(302, 102, 128, 46, "Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF870000")
        GUIEditor.button[6] = guiCreateButton(302, 158, 128, 46, "Powt?rz Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FF870000")
        GUIEditor.button[7] = guiCreateButton(58, 214, 244, 59, "Zarejestruj !", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF025502")    

        guiSetVisible ( GUIEditor.window[1], false )

        local localPlayer = getLocalPlayer ( )
        end
);

function windowHandler( )
    local playername = getPlayerName(localPlayer)
    
    guiSetText(LoginUsername, "")
    guiSetText(EditRegisterUsername, "")

    guiSetText(LoginUsername, playername)
    guiSetText(EditRegisterUsername, playername)

    guiSetVisible (  GUIEditor_Window[1], true )

    guiSetInputEnabled(true)
    showCursor ( true )
end

function onClickBtn ( button, state )
    if (source == GUIEditor_Button[1]) then
        triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) )
    end
end

function onClickBtn2 ( button, state )
    if (source == GUIEditor_Button[7]) then
        triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword))
    end
end


function hideLoginWindow()
    guiSetInputEnabled(false)
    guiSetVisible ( GUIEditor_Window[1], false )
    showCursor ( false )
end
addEvent( "hideLoginWindow", true )
addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )

addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false )
addEventHandler ( "onClientGUIClick", GUIEditor_Button[7], onClickBtn2, false )

s-side

function onLogin ( player, user, pass )
    local account = getAccount ( user, pass )
    if ( account ~= false ) then
        if (logIn ( player, account, pass ) == true) then
            triggerClientEvent ( "hideLoginWindow", getRootElement())
        else
            outputChatBox ( "Blad logowania!", player, 255, 255, 0 ) -- Output they got the details wrong.
        end
    else
        outputChatBox ( "Nie prawidlowe haslo/login!", player, 255, 255, 0 ) -- Output they got the details wrong.
    end
end

addEvent( "onLogin", true )
addEventHandler( "onLogin", getRootElement(), onLogin )

function onRegister ( player, user, pass )
    local account = getAccount ( user, pass )
    if ( account ~= false ) then
        if (logIn ( player, account, pass ) == true) then
            triggerClientEvent ( "hideLoginWindow", getRootElement())
        else
            outputChatBox ( "blad logowania!", player, 255, 255, 0 ) -- Output they got the details wrong.
        end
    else
        account = addAccount ( user, pass )
        if (logIn ( player, account, pass ) == true) then
            triggerClientEvent ( "hideLoginWindow", getRootElement())
        else
            outputChatBox ( "blad logowania/rejestrowania!", player, 255, 255, 0 ) -- Output they got the details wrong.
        end
    end
end

addEvent( "onRegister", true )
addEventHandler( "onRegister", getRootElement(), onRegister )

Mo?? ?le przypisa?em w funkcjach Przyciski ju? nwm ;p ok
meta.xml

<meta>
<info author="mkhb" version="1.0.1" type="script" name="log"/> 
    <script src="client.lua" type="client" />
    <script src="server.lua" type="server" />    
</meta>


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-24, 19:05


dudeks







Wiek: 32
Na forum: 6717 dni
Posty: 171

Piwa: 89

Respekt: 105,3
Respekt: 105,3

Strona klienta:

GUIEditor = {
    button = {},
    window = {},
    edit = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(0, 221, 1366, 302, "Witamy Na Serwerze RPG (PL)", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.edit[1] = guiCreateEdit(799, 44, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[1] = guiCreateButton(1059, 45, 150, 103, "Akceptuje", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(676, 46, 123, 44, "Login", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF020578")
        GUIEditor.edit[2] = guiCreateEdit(799, 44, 238, 46, getPlayerName(localPlayer), false, GUIEditor.window[1])
        GUIEditor.edit[3] = guiCreateEdit(799, 92, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(678, 92, 121, 46, "Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF790000")
        GUIEditor.edit[4] = guiCreateEdit(57, 46, 238, 46, getPlayerName(localPlayer), false, GUIEditor.window[1])
        GUIEditor.edit[5] = guiCreateEdit(57, 102, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.edit[6] = guiCreateEdit(57, 158, 238, 46, "", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(302, 46, 128, 46, "Nick/Nazwa", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF030D53")
        GUIEditor.button[5] = guiCreateButton(302, 102, 128, 46, "Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF870000")
        GUIEditor.button[6] = guiCreateButton(302, 158, 128, 46, "Powt?rz Has?o", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FF870000")
        GUIEditor.button[7] = guiCreateButton(58, 214, 244, 59, "Zarejestruj !", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF025502")    

        guiSetInputEnabled(true)
        showCursor(true)
        
        addEventHandler ("onClientGUIClick", GUIEditor.button[1], onClickBtn, false)
        addEventHandler ("onClientGUIClick", GUIEditor.button[7], onClickBtn2, false)
    end)


function onClickBtn ( button, state )
    if (source == GUIEditor.button[1]) then
        triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(GUIEditor.edit[2]), guiGetText(GUIEditor.edit[3]) )
    end
end

function onClickBtn2 ( button, state )
    if (source == GUIEditor.button[7]) then
        triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(GUIEditor.edit[4]), guiGetText(GUIEditor.edit[5]))
    end
end


function hideLoginWindow()
    guiSetInputEnabled(false)
    guiSetVisible ( GUIEditor.window[1], false )
    showCursor ( false )
end
addEvent( "hideLoginWindow", true )
addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )



Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-24, 20:56


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

Dobra teraz dzia?a logowanie a rejestracja nie oczywi?cie leci piwko :) nwm co z rejestracj? pisa?o ?e co? z plikiem server ;d ale was ju? mecz? to ostatnia rzecz
Czy mo?na jako? zakry? has?o ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-24, 21:22


Dixers

No-Life






Wiek: 26
Na forum: 4453 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

MKHB, masz skrypt dodany w ACL? Dlatego reje nie dzia?a, je?li nie masz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-25, 16:34


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

jest dodane i nic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-25, 16:48


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

to :

account = addAccount ( user, pass )


zamie? na :

account = addAccount ( account, pass )


i sprawd?.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-25, 18:36


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

nic nie daje teraz jak rejestruj? to wywala b??d logowania ;d

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-25, 18:45


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

bo logowanie przez tostring musisz zrobi?.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-11-26, 19:33


MKHB







Wiek: 31
Na forum: 4396 dni
Posty: 22
Nick w MP: TheMCMKHB

Piwa: 1

Respekt: 50

czyli xD ?

[ Dodano: 2014-12-01, 20:35 ]
wywala takie co? .. : Client <nick> triggered serverside event onLogin but event is not added serverside . Logowanie dzia?a?o a teraz nie dzia?a ani to ani to :( ! co tu nie tak mo?e nie jestem jakim? Skrypterem ale si? ucz? ...

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: logowania :: coś :: nie :: tak
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panel logowania coś nie tak 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