08.02.2017, 14:54
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:
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;
}