Whats wrong with this code? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong with this code? (
/showthread.php?tid=301894)
Whats wrong with this code? -
vent - 06.12.2011
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?
Re: Whats wrong with this code? - T0pAz - 06.12.2011
Try using other hash. Never heard KryptiParool
Re: Whats wrong with this code? -
vent - 06.12.2011
Well, i just renamed it.
Re: Whats wrong with this code? - T0pAz - 06.12.2011
Show the code which called that Dialog