Password problem
#1

I have a problem where I type in a password and it says it incorrect.

pawn Code:
new pass[50];
                format(pass,50,"%s",strlen(inputtext));
                if(!strcmp(String2,pass,true) && strlen(pass))
                {
                    Init_CharData(playerid);
                    format(stringEX,128,"Welcome back %s!",charsinfo[playerid][user_name]);
                    SendClientMessage(playerid,COLOR_LIGHTYELLOW,stringEX);
                    playerinfo[playerid][login]=true;
                    playerinfo[playerid][updatereduce]=30;
                    getdate(yearEX,monthEX,dayEX);
                    gettime(hourEX,minEX,secEX);
                    format(queryEX, 256, "UPDATE `main_users` SET `timestamp`='%d/%d/%d - %d:%d:%d' WHERE `id`='%d' LIMIT 1;",yearEX,monthEX,dayEX,hourEX,minEX,secEX,mcinfo[playerid][mcid]);
                    mysql_query(queryEX);
                    freeze(playerid,0);
                } else
                {
                    playerinfo[playerid][Try]++;
                    format(stringEX,128,"Wrong password (%d/3)!",playerinfo[playerid][Try]);
                    ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", stringEX, "Login", "Cancel");
                    if(playerinfo[playerid][Try]==3)
                    {
                        SendClientMessage(playerid,COLOR_RED,"You have tried three times. You have been kicked from the server.");
                        Kick(playerid);
                    }
                }
Reply
#2

Quote:
Originally Posted by Samdudes
View Post
pawn Code:
format(pass,50,"%s",strlen(inputtext));
What do you want to effect with this? It confuses me a bit.
Reply
#3

It was orriginaly this:

pawn Code:
format(md5str,50,"%s",MD5_Hash(inputtext));
if(!strcmp(String2,md5str,true) && strlen(md5str))
But I'm not using the MD5_Hash now and I tried changing it but it didn't work :/
Reply
#4

Then just do this:
pawn Code:
if(!strcmp(String2, inputtext, false) && strlen(inputtext))
{
    // bla bla
}
Reply
#5

Cheers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)