Hello Guys i made a register system The problem is if click on the Login you will logged to account
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;
}
If you can login without any password you're most likely not caching any password for the user to enter.
Show me the code when the player account is first looked up for information (shoudl be somewhere under OnPlayerConnect)