Problem with password [rep+] - 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: Problem with password [rep+] (
/showthread.php?tid=568816)
Problem with password [rep+] -
TiXz0r - 25.03.2015
I have problem with password.
When im entering my password, like: yxcvbnm or asdfghjk or qwertzuiop, in .ini file password always be: 251790158
here is system for password:
udb_hash:
Код:
stock udb_hash(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;
}
other register system:
Код:
enum RegisterInfo
{
rPlayer,
rPass
// im delete others
}
Код:
public loadaccount_RegisterData(playerid, name[], value[])
{
INI_Int("Register",rInfo[playerid][rPlayer]);
INI_Int("Password",rInfo[playerid][rPass]);
// im delete others
return 1;
}
script on dilog system, where is entered password.
Код:
new INI:File = INI_Open(RegisterPath(playerid));
INI_SetTag(File,"RegisterData");
INI_WriteInt(File,"Register",0);
INI_WriteInt(File,"Password",udb_hash(inputtext));
// im delete others
INI_Close(File);
Re: Problem with password [rep+] -
zork - 25.03.2015
That's because you're hashing the passwords. That's what that stock is for.
Re: Problem with password [rep+] -
TiXz0r - 25.03.2015
im fix this.
but thanks for your reply