Problem with the Register System
#1

Hello Guys i made a register system The problem is if click on the Login you will logged to account
I mean you can login to any account without the password
Here is the code:

pawn Код:
if(dialogid == DIALOG_LOGIN)
    {
        if( response )
        {
            if(!fexist(UserPath(playerid)))
            {
                format(string, sizeof(string), "Welcome back to\nFresh RolePlay\n\nUsername: %s\n\nPlease provide your password:", NameL(playerid));
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login Form", string, "Login","Register");
                SendClientMessage(playerid, COLOR_DARKRED, "[Error] This account is not registered.");
                return 1;
            }
            if(!strlen(inputtext)) return format(string, sizeof(string), "Welcome back to\nFresh RolePlay\n\nUsername: %s\n\nPlease provide your password:", NameL(playerid));
            ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login Form", string, "Login","Register");
            //ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login Form", string, "Login","Register");
            SendClientMessage(playerid, COLOR_DARKRED, "[Error] This account is already registered.");

if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

else
            {
                format(string, sizeof(string), "Welcome back to\nFresh RolePlay\n\nUsername: %s\n\nPlease provide your password:", NameL(playerid));
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login Form", string, "Login","Register");
                SendClientMessage(playerid, COLOR_RED, "[Error] {777777}Thats the wrong password.");
            }
            return 1;
        }
        else
        {
            if(fexist(UserPath(playerid)))
            {
                format(string, sizeof(string), "Welcome back to\nFresh RolePlay\n\nUsername: %s\n\nPlease provide your password:", NameL(playerid));
                ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login Form", string, "Login","Register");
                SendClientMessage(playerid, COLOR_DARKRED, "[Error] This account is already registered.");
                return 1;
            }
Reply
#2

Any help?
Reply
#3

If you can login without any password you're most likely not caching any password for the user to enter.
Reply
#4

How i can do that?
Reply
#5

Show me the code when the player account is first looked up for information (shoudl be somewhere under OnPlayerConnect)
Reply
#6

Anyone close this thread Wolfe i made a new theard MySQL Problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)