25.03.2013, 20:23
Hello, my problem today is that my Login script won't accept any password, it just returns the incorrect password message.
pawn Код:
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
new password[256];
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Server Registration","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
WP_Hash(password, sizeof(password), inputtext);
INI_WriteString(File,"Password",password);
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash] = 5000);//$5000 at registration
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths] = 0);
for(new i; i < 12; i++)
{
new var[10];
format(var,sizeof(var),"Weapon%d", i);
INI_WriteInt(File,var,PlayerInfo[playerid][pWeapon][i] = 0);
}
for(new i; i < 12; i++)
{
new var[10];
format(var,sizeof(var),"Ammo%d", i);
INI_WriteInt(File,var,PlayerInfo[playerid][pAmmo][i] = 0);
}
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths] = 0);
INI_WriteString(File,"Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File,"Tutorial",PlayerInfo[playerid][pTutorial] = 0);
INI_WriteInt(File,"Mask",PlayerInfo[playerid][pMask] = 0);
INI_WriteString(File,"Flag",PlayerInfo[playerid][pFlag]);
INI_WriteInt(File,"Donator",PlayerInfo[playerid][pDonator] = 0);
INI_WriteInt(File,"Watch",PlayerInfo[playerid][pWatch] = 0);
INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge] = 0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Immigration","Welcome to the Republic of San Andreas\nPlease answer a few questions to become a Legal Citizen.","Ok","Quit");
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
new HashedPassword[256];
WP_Hash(HashedPassword, sizeof(HashedPassword), inputtext);
if(!strcmp(PlayerInfo[playerid][pPass], HashedPassword))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
OnPlayerLogin(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
}
return 1;
}
}
....