Jump to content

Login panel error


Recommended Posts

Hola a todos, tengo un problema, he creado un pequeño login, pero pues tengo el problema de que no me registra la cuenta, o almenos eso parece por que aparece como si la registrara pero al intentar logear con esta, da error. Aqui el codigo.

Server-Side

function serverLogin( username, password ) 
    if not (username == "") then 
        if not (password == "") then 
            local account = getAccount ( username, password ) 
            if ( account ~= false ) then 
                logIn(source, account, password) 
        outputChatBox("You successfully logged in", source, 0, 255, 0, true) 
    else 
        outputChatBox("Failed to login!", source, 255, 0, 0, true) 
            end 
        end 
    end 
end  
addEvent("player:login", true) 
addEventHandler("player:login", getRootElement(), serverLogin) 
  
function serverRegister( username, password ) 
    local account = getAccount ( username, password ) 
    if (account == false) then 
        addAccount(tostring(username),tostring(password)) 
        outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) 
    else 
        outputChatBox("Failed to register!", source, 255, 0, 0, true) 
    end 
end 
addEvent("player:register", true) 
addEventHandler("player:register", getRootElement(), serverRegister) 

Link to comment

o.O No entinedo aveces funciona aveces no les paso el codigo....

Client-Side

---Trigger Register 
addEventHandler("onClientClick", getRootElement(), 
    function( button, state, px, py ) 
        if ( button == "left" and state == "down" ) then 
            if ( px > 266 and px < 359 and py > 634 and py < 674 ) then 
                    local username = guiGetText( user_edit ) 
                    local password = guiGetText( pass_edit ) 
                    if ( user ~= "" and pass ~= "" ) then 
                --  outputChatBox("El boton de register funciona!", 255, 255, 255, true) 
                        triggerServerEvent("player:register", getLocalPlayer(), username, password) 
                end 
            end 
        end 
    end 
) 

Server-Side

function serverRegister( username, password ) 
    local account = getAccount ( username, password ) 
    if (account == false) then 
        addAccount(tostring(username),tostring(password)) 
        outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) 
        outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) 
    else 
        outputChatBox("Failed to register!", source, 255, 0, 0, true) 
    end 
end 
addEvent("player:register", true) 
addEventHandler("player:register", getRootElement(), serverRegister) 

Link to comment

o.O No entinedo aveces funciona aveces no les paso el codigo....

Client-Side

---Trigger Register 
addEventHandler("onClientClick", getRootElement(), 
    function( button, state, px, py ) 
        if ( button == "left" and state == "down" ) then 
            if ( px > 266 and px < 359 and py > 634 and py < 674 ) then 
                    local username = guiGetText( user_edit ) 
                    local password = guiGetText( pass_edit ) 
                    if ( user ~= "" and pass ~= "" ) then 
                --  outputChatBox("El boton de register funciona!", 255, 255, 255, true) 
                        triggerServerEvent("player:register", getLocalPlayer(), username, password) 
                end 
            end 
        end 
    end 
) 

Server-Side

function serverRegister( username, password ) 
    local account = getAccount ( username, password ) 
    if (account == false) then 
        addAccount(tostring(username),tostring(password)) 
        outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) 
        outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) 
    else 
        outputChatBox("Failed to register!", source, 255, 0, 0, true) 
    end 
end 
addEvent("player:register", true) 
addEventHandler("player:register", getRootElement(), serverRegister) 

Link to comment

o.O No entinedo aveces funciona aveces no les paso el codigo....

Client-Side

---Trigger Register 
addEventHandler("onClientClick", getRootElement(), 
    function( button, state, px, py ) 
        if ( button == "left" and state == "down" ) then 
            if ( px > 266 and px < 359 and py > 634 and py < 674 ) then 
                    local username = guiGetText( user_edit ) 
                    local password = guiGetText( pass_edit ) 
                    if ( user ~= "" and pass ~= "" ) then 
                --  outputChatBox("El boton de register funciona!", 255, 255, 255, true) 
                        triggerServerEvent("player:register", getLocalPlayer(), username, password) 
                end 
            end 
        end 
    end 
) 

Server-Side

function serverRegister( username, password ) 
    local account = getAccount ( username, password ) 
    if (account == false) then 
        addAccount(tostring(username),tostring(password)) 
        outputChatBox("Te has registrado exitosamente! #ff9e00(#ffffff"..username..", "..password.."#ff9e00)#ffffff.", source, 255, 255, 255, true) 
        outputChatBox("Ahora puedes logearte!", source, 255, 255, 255, true) 
    else 
        outputChatBox("Failed to register!", source, 255, 0, 0, true) 
    end 
end 
addEvent("player:register", true) 
addEventHandler("player:register", getRootElement(), serverRegister) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...