06.12.2011, 11:12
Well, this code says that the password is wrong, but it isnt.
Dialog code:
And the KryptiParool stock made by DracoBlue:
Help?
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;
}
}
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;
}