Jump to content

Login panel error


Recommended Posts

Posted

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) 

Posted

que raro no tiene ningun problema tu codigo lo acabo de provar y me funciona prefectamente

asegurate bien de darle permisos de admin en el ACL

"resource.login"> ---- enves de login debes poner el nombre de tu script 

Posted
Si, tiene permisos de admin & todo o.O pero no se que falla...

que raro @XeroxMta como te dije yo lo prove y no me dio ningun problema me registro correctamente y me pude logear tambien correctamente

Posted
No se .-. Reinicie el servidor y ya registraba y todo xD

cada vez que editas la acl por la carpeta en vez por panel, tendrás que reiniciar el servidor entero, por eso es mejor vía panel.

Posted
Se puede editar desde el archivo y luego reiniciar el ACL...

¿Y que comando es?

Yo solo conozco el reloadacl pero que yo sepa solo esta en paradise.

Posted

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) 

Posted

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) 

Posted

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) 

  • Recently Browsing   0 members

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