25.03.2014, 20:03
How does this even compile without errors!?
Use strcmp to compare 2 strings. I think this was the problem here.
Complete code:
EDIT: thanks for the info Konstantinos, learned something new I guess
pawn Code:
if(!strcmp(udb_hash(inputtext),PlayerInfo[playerid][pPass]))
{
//code
}
Complete code:
pawn 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;
}