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

Wysłany: 2016-07-28, 14:09


xDanioPLx

LuA






Wiek: 24
Na forum: 4557 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 889

Respekt: 40

Ostrzeżeń: 100%
Cze??,mam problem z panelem logowania a w?a?ciwie jak pr?buje sie zarejestrowa? to wyskakuje oto ten b??d za pomoc daje :piwo: + R*

Kod:
c-side
gui nie podaje bo nie potrzeba.

addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), 
function()
addEventHandler ("onClientRender", getRootElement(), panelek)
guiSetVisible (loguj, true)
guiSetVisible (rejestruj, true)
guiSetVisible (login, true)
guiSetVisible (haslo, true)
showCursor (true)
end
)



function zaloguj(button, state)
       if button == "left" and state == "up" then
        local username = guiGetText(login)
         local password = guiGetText(haslo)
          if username and password then
            triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password)
          else
         guiSetText(niedogodnosci, "Wpisz swoj login i haslo!")
      end    
   end
end
addEventHandler("onClientGUIClick", loguj, zaloguj, false)

function zarejestuj(button, state)
    if button == "left" and state == "up" then
        local username = guiGetText(login)
        local password = guiGetText(haslo)
        if username and password then
            if (string.len(username)>=4) then
                if (string.len(password)>=4) then        
                triggerServerEvent(getLocalPlayer(), "submitRegister", getRootElement(), username, password)
                else
                guiSetText(niedogodnosci, "Has?o uzytkownika musi zawiera? co najmniej 4 znaki.")
                end   
            else
            guiSetText(niedogodnosci, "Login uzytkownika musi zawierac co najmniej 4 znaki.")    
            end
        else
        guiSetText(niedogodnosci, "Wpisz sw?j login i has?o.")
        end
    end 
end
addEventHandler("onClientGUIClick", rejestruj, zarejestuj, false)

function hideLoginWindow()
removeEventHandler ("onClientRender", getRootElement(), panelek)
guiSetVisible (loguj, false)
guiSetVisible (rejestruj,false)
guiSetVisible (login, false)
guiSetVisible (haslo, false)
showCursor (false)
end
addEvent("hideLoginWindow", true)
addEventHandler("hideLoginWindow", getResourceRootElement(getThisResource()), hideLoginWindow)


B?ad w debugu
http://screenshot.sh/mFdKMOBoePGRP

Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 15:28


Jacob

Głupiomądry






Wiek: 28
Na forum: 5643 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

triggerServerEvent(getLocalPlayer(), "submitRegister", getRootElement(), username, password)

na
triggerServerEvent("submitRegister", getLocalPlayer(), username, password)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 15:54


xDanioPLx

LuA






Wiek: 24
Na forum: 4557 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 889

Respekt: 40

Ostrzeżeń: 100%
nie dzia?a wsykakuje ten error http://screenshot.sh/mGwl3zP53jpuV

Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 15:54


Jacob

Głupiomądry






Wiek: 28
Na forum: 5643 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Nie masz dodanego eventu po stronie pliku serwerowego.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 15:58


xDanioPLx

LuA






Wiek: 24
Na forum: 4557 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 889

Respekt: 40

Ostrzeżeń: 100%
Ustawi?em tak
triggerServerEvent (localPlayer, "submitRegister",getRootElement(),username, password)
ale teraz wyskakuje warning ten http://screenshot.sh/mFdKMOBoePGRP

[ Dodano: 2016-07-28, 15:59 ]
s-side

function Loguj_Server(gracz,username, password)
    local account = getAccount(username, password)
    if (account ~= false) then
        if (logIn(gracz, account, password) == true) then
            triggerClientEvent(gracz,"hideLoginWindow",getRootElement())
            outputChatBox("[GameWorld] Pomyslnie zalogowano na konto",gracz,255,255,255,true)
        else
        outputChatBox("[GameWorld] System nie moze za?adowac konta przepraszamy za utrudnienia.",gracz,255,255,255,true)
        end
    else
    outputChatBox("[GameWorld] Poda?es z?y login lub has?o.",gracz,255,255,255,true)
    end
end

addEvent("submitLogin",true)
addEventHandler("submitLogin",getRootElement(),Loguj_Server)

function Rejestruj_Server(gracz,username, password)
    local account = getAccount(username, password)
    if (account ~= false) then
    outputChatBox("[GameWorld] Takie konto ju? istnieje na serwerze prosze wybra? inne.",gracz,255,255,255,true)
    else
            account = addAccount(username, password)

            setElementData(gracz,"konto_login",username)
            outputChatBox("[GameWorld] Konto zosta?o pomyslnie zarejstrowane.", gracz, 0, 255, 0)

    end
end 

function setCameraOnPlayerJoin()
     fadeCamera(source, true, 10)
     setCameraMatrix(source, -2013.90, 920.48, 58.83, -918.42474365234, 99.881813049316)
end
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin)


Podpis

Los Santos Gaming MTA-60%

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 17:59


marcin778

Krytyk serwerów MTA






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

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

function Loguj_Server(gracz,username, password)
    local account = getAccount(username, password)
    if (account ~= false) then
        if (logIn(gracz, account, password) == true) then
            triggerClientEvent(gracz,"hideLoginWindow",getRootElement())
            outputChatBox("[GameWorld] Pomyslnie zalogowano na konto",gracz,255,255,255,true)
        else
        outputChatBox("[GameWorld] System nie moze za?adowac konta przepraszamy za utrudnienia.",gracz,255,255,255,true)
        end
    else
    outputChatBox("[GameWorld] Poda?es z?y login lub has?o.",gracz,255,255,255,true)
    end
end

addEvent("submitLogin",true)
addEventHandler("submitLogin",getRootElement(),Loguj_Server)

function Rejestruj_Server(gracz,username, password)
    local account = getAccount(username, password)
    if (account ~= false) then
    outputChatBox("[GameWorld] Takie konto ju? istnieje na serwerze prosze wybra? inne.",gracz,255,255,255,true)
    else
            account = addAccount(username, password)

            setElementData(gracz,"konto_login",username)
            outputChatBox("[GameWorld] Konto zosta?o pomyslnie zarejstrowane.", gracz, 0, 255, 0)

    end
end 
addEvent("submitRegister", true)
addEventHandler("submitRegister",getRootElement(), Rejestruj_Server)

function setCameraOnPlayerJoin()
     fadeCamera(source, true, 10)
     setCameraMatrix(source, -2013.90, 920.48, 58.83, -918.42474365234, 99.881813049316)
end
addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin)


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

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

 
Wysłany: 2016-07-28, 18:01


xDanioPLx

LuA






Wiek: 24
Na forum: 4557 dni
Posty: 24
Nick w MP: xDanioPLx

Piwa: 889

Respekt: 40

Ostrzeżeń: 100%
Dzieki stawiam :piwo: i R* !:)
Temat do zamkniecia.

Podpis

Los Santos Gaming MTA-60%

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