19.01.2012, 00:03
I've got an enum;
And I use this function to load the data..
In order to register through a dialog, I do this to write the password to the file..
and I check if the password is correct by using..
This part does not seem to work (the password is correct check); What's wrong?
EDIT: Here's my entire login dialog if that helps any:
pawn Код:
enum pData
{
Password[64],
..
}
new p_Data[MAX_PLAYERS][pData];
pawn Код:
public LoadUser_data(playerid,name[],value[])
{
INI_String( "Password", p_Data[playerid][Password], 64);
..
return 1;
}
pawn Код:
format(pTxt, 64, "%s", inputtext);
INI_WriteString(AccountData, "Password", pTxt);
pawn Код:
if(strcmp(inputtext, p_Data[playerid][Password], true) == 0) {
EDIT: Here's my entire login dialog if that helps any:
pawn Код:
case d_Login: {
if(!response) {
SendClientMessage(playerid, COLOR_ERROR, "Sorry! You are required to register before playing!");
return Kick(playerid);
}
if(!strlen(inputtext))
return ShowPlayerDialog(playerid, d_Login, DIALOG_STYLE_PASSWORD, "{009AC9}Welcome back!", "{FFFFFF}Please type your {2A9107}password {FFFFFF}below to access your account information!", "Connect", "Quit");
printf("%s", inputtext);
if(strcmp(inputtext, p_Data[playerid][Password], true) == 0) {
TogglePlayerSpectating(playerid, 0);
INI_ParseFile(FetchTheirAccountLocation(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, p_Data[playerid][Money]);
SetSpawnInfo(playerid, 0, p_Data[playerid][SkinModel], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else return ShowPlayerDialog(playerid, d_Login, DIALOG_STYLE_PASSWORD, "{009AC9}Welcome back!", "{FFFF00}You have entered an incorrect password!\n{FFFFFF}Please type your {2A9107}password {FFFFFF}below to access your account information!", "Connect", "Quit");
}