07.07.2011, 13:44
Hey guys,
Im working on my admin FS, and i got a problem with the password (again..). Everything saves good when you registered your account. When you disconnect, it saves all the things aswell. But now, when i try to login (when i already registered my account) i can login with any password. Ive checked my scriptfiles folder, for my file. I saw that the line where my password should be, is gone
Anyone can take a look at those pieces and tell me whats wrong
NOTE: I know there is no file[128], name[24], format(file) etc, but thats in my OnDialogResponse callback
Im working on my admin FS, and i got a problem with the password (again..). Everything saves good when you registered your account. When you disconnect, it saves all the things aswell. But now, when i try to login (when i already registered my account) i can login with any password. Ive checked my scriptfiles folder, for my file. I saw that the line where my password should be, is gone
Anyone can take a look at those pieces and tell me whats wrong
NOTE: I know there is no file[128], name[24], format(file) etc, but thats in my OnDialogResponse callback
pawn Код:
//Player disconnect:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid, name, sizeof name); format(file, sizeof file, PlayerFile, name);
djSetInt(file, "Loads/Money", GetPlayerMoney(playerid));
djSetInt(file, "Loads/Score", GetPlayerScore(playerid));
djSetInt(file, "Misc/Logged", 0);
djCommit(file);
return 1;
}
//Register dialog
if(dialogid == REGISTER)
{
if(response)
{
new buffer[129];
WP_Hash(buffer, sizeof buffer, inputtext);
GetPlayerIp(playerid, pIp, sizeof pIp);
djCreateFile(file);
djSet(file, "Important/Name", name);
djSet(file, "Important/Password", buffer);
djSet(file, "Important/Ip", pIp);
djSetInt(file, "Loads/Money", 500);
djSetInt(file, "Loads/Score", 0);
djSetInt(file, "Level/Admin level", 0);
djSetInt(file, "Level/Vip level", 0);
djSetInt(file, "Misc/Registered", 1);
djSetInt(file, "Misc/Logged", 1);
GivePlayerMoney(playerid, 500);
djCommit(file);
return 1;
}
}
// Login dialog
if(dialogid == LOGIN)
{
if(response)
{
new buffer[129];
WP_Hash(buffer, sizeof buffer, inputtext);
if(!strcmp(buffer, dj(file, "Important/Password"), false, 16))
{
new String[128], AdminStatus[128], VipStatus[128];
GivePlayerMoney(playerid, djInt(file, "Loads/Money"));
SetPlayerScore(playerid, djInt(file, "Loads/Score"));
djSetInt(file, "Misc/Logged", 1);
djCommit(file);
return 1;
}
}
}