07.07.2014, 23:33
Yes I realise that, what I'm saying is that he is trying to compare an integer with a string rather than a string with a string.
Not much knowledge of udb once again, but this is my attempt.
pawn Код:
stock udb_CheckLogin(nickname[], pwd[])
{
new fname[MAX_STRING], hashpass[129];
WP_Hash(hashpass, sizeof(hashpass), pwd);
format(fname, sizeof(fname), "SFTDM/Users/%s.sav", udb_encode(nickname));
if(!strcmp(udb_User(nickname, "password_hash"), hashpass, false)) return true;
return false;
}
stock udb_Create(nickname[], pwd[])
{
if (udb_Exists(nickname)) return false;
new fname[MAX_STRING], hashpass[129];
WP_Hash(hashpass, sizeof(hashpass), pwd);
format(fname, sizeof(fname), "SFTDM/Users/%s.sav", udb_encode(nickname));
dini_Create(fname);
udb_UserSet(nickname, "password_hash", hashpass);
return true;
}