31.05.2014, 17:44
Strcmp returns 0 if the strings you compare match and 1/-1 if they don't. So bassicaly if you introduce your good password you won't be able to login. Change the if condition
https://sampwiki.blast.hk/wiki/Strcmp
pawn Код:
if(dialogid == LOGIN_DIALOG)
{
if(!response)
{
ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Login", "Type in your password", "Login", "Cancel");
}
else
{
new escapedPassword[129];
WP_Hash(escapedPassword, sizeof(escapedPassword), inputtext);
if(strcmp(escapedPassword,PlayerInfo[playerid][pPass],true))
{
SendClientMessage(playerid, -1, "Incorrect Password Entered - Please try again.");
ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_PASSWORD, "Login", "Type in your password", "Login", "Cancel");
}
else
{
format(GlobalString, sizeof(GlobalString), "Welcome "COL_LIGHTBLUE"%s!",GetName(playerid));
SendClientMessage(playerid, -1, GlobalString);
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pAngle], 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, false);
}