25.03.2014, 18:27
(
Last edited by TLN; 28/03/2014 at 04:00 PM.
)
The password problem has been fixed, the fix has been posted.
if(!strcmp(udb_hash(inputtext),PlayerInfo[playerid][pPass]))
{
//code
}
case DIALOG_LOGIN:
{
if (!response) return Kick (playerid);
if(response)
{
if(!strcmp(udb_hash(inputtext),PlayerInfo[playerid][pPass]))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWanted]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Invalid Password!\n"COL_WHITE"Type Your Password Below To Login","Login","Leave");
}
return 1;
}
}
}
return 1;
}
printf("udb_hash->inputtext: %i & pPass: %i", udb_hash(inputtext), PlayerInfo[playerid][pPass]);
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
[22:00:47] udb_hash->inputtext: 73204161 & pPass: 0 |
public OnPlayerConnect( playerid ) { if(fexist(UserPath(playerid))) // If the account exists. { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); //Show login dialog. } else { //Show register dialog. } }
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login","Login","Leave");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Type your password below to register","Register","Leave");
}
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
// And the rest...
return 1;
}