Whats wrong with this code?
#1

Well, this code says that the password is wrong, but it isnt.

Dialog code:
pawn Код:
case 2: //Login
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(KryptiParool(inputtext) == KasutajaInfo[playerid][pParool])
                {
                    INI_ParseFile(KasutajaKaust(playerid), "KasutajaKaust_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, KasutajaInfo[playerid][pRaha]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT,""COL_WHITE"Logi sisse",""COL_RED"Sa sisestasid vale parooli.\n"COL_WHITE"Sisesta oma хige parool, et mдngida.","Logi sisse","Lahku");
                }
                return 1;
            }
        }
And the KryptiParool stock made by DracoBlue:
pawn Код:
stock KryptiParool(buf[])
{
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Help?
Reply
#2

Try using other hash. Never heard KryptiParool
Reply
#3

Well, i just renamed it.
Reply
#4

Show the code which called that Dialog
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)