30.01.2014, 19:34
Hey, i made my register and login system and its working no errors but when i type my password its saved and i try to login and it says false password. My ondialog response:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTRACIJA:
{
new servermemorija[128], igraci[MAX_PLAYER_NAME];
GetPlayerName(playerid, igraci, sizeof(igraci));
format(servermemorija, sizeof(servermemorija), "/Igraci/%s.ini", igraci);
if(!response)return Kick(playerid);
if(response)
{
if(!strlen(inputtext))return ShowPlayerDialog(playerid, DIALOG_REGISTRACIJA, DIALOG_STYLE_INPUT, "Registracija", "Dobrodosao na Beogradski Sindikat.\n\nNalog: Nije pronadjen.\n\nUpisite vas password za registraciju.", "Ok", "Odustani");
dini_Create(servermemorija);
dini_IntSet(servermemorija, "Lozinka", udb_hash(inputtext));
dini_IntSet(servermemorija, "Admin", StatsIgraca[playerid][Admin]);
dini_IntSet(servermemorija, "Novac", StatsIgraca[playerid][Novac]);
dini_IntSet(servermemorija, "Level", StatsIgraca[playerid][Level]);
StatsIgraca[playerid][Admin] = dini_Int(servermemorija, "Admin");
StatsIgraca[playerid][Novac] = dini_Int(servermemorija, "Novac");
StatsIgraca[playerid][Level] = dini_Int(servermemorija, "Level");
}
}
case DIALOG_LOGIN:
{
new servermemorija[128], igraci[MAX_PLAYER_NAME], tmp;
tmp = dini_Int(servermemorija, "Lozinka");
GetPlayerName(playerid, igraci, sizeof(igraci));
format(servermemorija, sizeof(servermemorija), "/Igraci/%s.ini", igraci);
if(!response)return Kick(playerid);
if(!strlen(inputtext))return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Dobrodosao na Beogradski Sindikat.\n\nNalog: Pronadjen.\n\nUpisite vas password za login.", "Ok", "Odustani");
if(udb_hash(inputtext) != tmp)
{
SendClientMessage(playerid, -1, "BSRP: (( NETECAN PASSWORD ! ))");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Dobrodosao na Beogradski Sindikat.\n\nNalog: Pronadjen.\n\nUpisite vas password za login.", "Ok", "Odustani");
}
else
{
StatsIgraca[playerid][Logovan]++;
StatsIgraca[playerid][Admin] = dini_Int(servermemorija, "Admin");
SetPlayerScore(playerid, StatsIgraca[playerid][Level]);
GivePlayerMoney(playerid, dini_Int(servermemorija, "Novac")-GetPlayerMoney(playerid));
SendClientMessage(playerid, -1, "BSRP: (( USPESAN LOGIN ! ))");
}
}
}
return 1;
}