Jump to content

Login script help


Recommended Posts

Hello, so i have a login script here but what i wanna know is if someone could help me add mysql to it so i could register on website and login ingame

function PlayerLogin(username,password,checksave) 
    if not (username == "") then 
        if not (password == "") then 
            local account = getAccount ( username, password ) 
            if ( account ~= false ) then 
                logIn(source, account, password) 
                 
                triggerClientEvent (source,"hideLoginWindow",getRootElement()) 
                 
                    if checksave == true then 
                        triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) 
                    else 
                        triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) 
                    end 
                     
            else 
                triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Wrong username and/or password!") 
            end 
        else 
            triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your password!") 
        end 
    else 
        triggerClientEvent(source,"set_warning_text",getRootElement(),"Login","Please enter your username!") 
    end 
end 
  
addEvent("onRequestLogin",true) 
addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) 

Link to comment

Why you would do such thing ? If you wanna that the player must be registred on your webpage and only after he can register on the server. Then why you don't ask them enter the forum name and after check if there is a usser with that name on the forum ?

Link to comment
Why you would do such thing ? If you wanna that the player must be registred on your webpage and only after he can register on the server. Then why you don't ask them enter the forum name and after check if there is a usser with that name on the forum ?

Your post makes no sense, im not wanting them to register on webpage and only after can they register on the server, they register on webpage and only after they can LOGIN to the server.

Your code don't mean nothing. I think nobody didn't make it for free. It's hard job. And I understood that you don't know lua, so look for paid scripters or learn lua.

I also think your a really rude person, And how come you think i dont know lua? Maybe i don't, but you dont gotta be so rude about it

Connect it on the server side with the mysql server of the website and then excecute everything with dbExec.

The thing is though, i dont know what code and stuff i would use to connect it server sided to the website and I would have no idea where to start, could you possibly help me out?

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...