Register and Login
#1

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;
}
Reply


Messages In This Thread
Register and Login - by MatriXgaMer - 30.01.2014, 19:34
Re: Register and Login - by SwisherSweet - 30.01.2014, 19:47
Re: Register and Login - by Mystique - 30.01.2014, 19:48
Re: Register and Login - by MatriXgaMer - 30.01.2014, 19:51
Re: Register and Login - by Mystique - 30.01.2014, 19:56
Re: Register and Login - by MatriXgaMer - 30.01.2014, 19:57
Re: Register and Login - by Mystique - 30.01.2014, 20:00
Re: Register and Login - by MatriXgaMer - 30.01.2014, 20:28
Re: Register and Login - by Mystique - 30.01.2014, 20:33
Re: Register and Login - by MatriXgaMer - 30.01.2014, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)