Problem on login
#1

pawn Код:
if(dialogid == 3)
  {
    if(response == 1)
        {
        if(IsPlayerConnected(playerid))
          {
            if(strlen(inputtext))
            {
              new idx;
                    new tmp[256];
                    new tmppass[64];
                    tmp = strtok(inputtext, idx);
                    strmid(tmppass, tmp, 0, strlen(inputtext), 255);
                    Encrypt(tmppass);
                    OnPlayerLogin(playerid,tmppass);
              return 1;
            }
            else
            {
              ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Error","Enter Password","Login","Dissconect");
              return 1;
            }
            }
        }
        if(response == 2)
        {
            Kick(playerid);
        }
  }
But when i type space , it loging me on normaly,like i type the good password
How to fix ? or how to detect if the password begins with a space ?

LE : http://pastebin.com/m132a7e97
The OnPlayerLogin Function http://pastebin.com/m119d9413
Reply
#2

May be something wrong with your password checking function OnPlayerLogin(playerid,tmppass);
Reply
#3

Are you encrypting the players password in OnPlayerRegister? If not, comment out Encrypt(tmppass);
Reply
#4

Yes , i'm encrypting it
Reply
#5

UP!
Can someone help me ?
Reply
#6

Can you give me your OnPlayerLogin code?
Reply
#7

The OnPlayerLogin Function http://pastebin.com/m119d9413
Reply
#8

UP !!
Reply
#9

Do a length check when comparing the passwords, since strcmp will return false if one string is empty.
Reply
#10

How ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)