15.12.2013, 20:20
I did this in stead:
And in OnPlayerConnect:
And when the login dialog responds in OnDialogRespond:
It does not give any errors when I compile, but no matter what password I type when logging in, I get logged in.
pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
new buf[129];
INI_String("password", buf, sizeof(buf));
PlayerInfo[playerid][pPassword] = strval(buf);
return 1;
}
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
pawn Код:
new buf[129];
if (WP_Hash(buf, sizeof(buf), inputtext) != PlayerInfo[playerid][pPassword])
{
new string[80 + MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "{FFFF00}Your username: {FFFFFF}%s\n\n{AF0000}Incorrect password!\n\n{FFFF00}Enter your Password to log in",name);
ShowPlayerDialog(playerid, MENU_LOGIN, DIALOG_STYLE_PASSWORD, "Hopes Hills RP Account", string, "Login", "Quit");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "-MSG- Welcome back!");
}