SA-MP Forums Archive
Problem with the Register System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with the Register System (/showthread.php?tid=628266)



Problem with the Register System - Barnwell - 08.02.2017

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;
            }



Re: Problem with the Register System - Barnwell - 08.02.2017

Any help?


Re: Problem with the Register System - Wolfe - 08.02.2017

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


Re: Problem with the Register System - Barnwell - 08.02.2017

How i can do that?


Re: Problem with the Register System - Wolfe - 08.02.2017

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


Re: Problem with the Register System - Barnwell - 08.02.2017

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