Jump to content

Login section error...


Recommended Posts

Hey all....i got an error from this login... can you tell me whats wrong??

Client-Side

addEventHandler ( "onClientClick", getRootElement(), 
function ( button, state, px, py ) 
        if ( button == "left" and state == "down" ) then 
            if ( px > x*0.382 and px < x*0.555 and py > y*0.719 and py < y*0.79 ) then 
                if ( isLoginActive ) then 
                    playSound("Sounds/button1.mp3", false) 
                    local user = guiGetText( Login_User ) 
                    local pass = guiGetText( Login_Password ) 
                    if ( user ~= "" and pass ~= "" ) then 
                    triggerServerEvent("player:register", getRootElement(), getLocalPlayer(), user, pass) 
end 

Server-Side

function server.register (thePlayer, Username, Password) 
        if ( thePlayer ~= "" and Username ~= "" and Password ~= "" ) then 
            addAccount( Username, Password ) 
            triggerClientEvent( thePlayer, "player:loginNotification", getRootElement(), true ) 
            triggerClientEvent( thePlayer, "server:note", getRootElement(), "success", "You successfully registered") 
            return true 
        else 
            triggerClientEvent( thePlayer, "server:note", getRootElement(), "error", "Error on register") 
            triggerClientEvent( thePlayer, "player:loginNotification", getRootElement(), false ) 
            return false 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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