29.03.2012, 13:40
Bug [ Bug ]
It wont read the password
and the login trials wont go up or wont work please help me
I am using dracoBlue hash
It wont read the password
and the login trials wont go up or wont work please help me
pawn Код:
if(response)
{
if(udb_hash(inputtext) == pData[playerid][pPassword])
{
INI_ParseFile(PlayerPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid,C_BOT,"iBot:"CWHITE" You have logged in to your account");
}
else
{
new takes[MAX_PLAYERS],trial[128],LoginString[500],string[128];
takes[playerid] += 1;
switch(takes[playerid])
{
case 1: trial = ""CORANGE"Three more trials left"CWHITE"";
case 2: trial = ""CORANGE"Two more trials left"CWHITE"";
case 3: trial = ""CRED"One more trials left"CWHITE"";
case 4:
{
format(string,128,"iBot:"CWHITE" %s has been kicked from the server due to ["CREASON" Failure to login 3x"CWHITE"]",PlayerName(playerid));
SendClientMessageToAll(C_BOT,string);
Kick(playerid);
}
}
format(LoginString,sizeof(LoginString),""CWHITE"This Account is Registred \n\nUser:"CORANGE" %s "CWHITE"\n\nPlease Enter Your password bellow to Login\n\n%s before we will do actions",PlayerName(playerid),trial);
ShowPlayerDialog(playerid,D_LOGIN,PASSWORD,""CSERVER"RicaNiel -"CWHITE" Administration",LoginString,"Login","Cancel");
}
}
pawn Код:
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;
}