Help system accounts MYSQL error with the passwords..
#1

hello there!, i have the next error in my code. when you login in an account if you press enter (if you don't put any letter, if you let a white space) will let that you enter in this account... then i have been triying resolve this problem but, i haven't got success.

Код:
case LOGIN:
        {
            if(!response)
            {
                Kick(playerid);
            }
            new sblank[] = "";
			if(strcmp(sblank, inputtext))
			{
                SendClientMessage(playerid, -1, "[TNW] write your mail");
                format(string, sizeof(string), "[TNW] Error complete the space.");
				ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "mail:",string,"next", "exit");
   			}
			else
			{*/
			    if(strcmp(PlayerInfo[playerid][mail], inputtext, true, 129) == 0)
	            {
	                format(string, sizeof(string), "[TNW] write your pass");
	                ShowPlayerDialog(playerid, LOGIN2, DIALOG_STYLE_PASSWORD,"contraseсa:",string,"next","exit");
	            }
	            else
	            {
	                SendClientMessage(playerid, -1, "[TNW] Error incorrect mail.");
	                format(string, sizeof(string), "[TNW] Error invalid mail.");
					ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "mail:",string,"next", "exit");
	            }
     		}
how you can see i try to create a variable string named sblank to compare with the inputtext, but it don't worked
Reply
#2

You want to see if he didn't type nothing?

At the top of your script:

pawn Код:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
Change the code to:

pawn Код:
case LOGIN:
        {
            if(!response)
            {
                Kick(playerid);
            }
            if(IsNull(inputtext))
            {
                SendClientMessage(playerid, -1, "[TNW] write your mail");
                format(string, sizeof(string), "[TNW] Error complete the space.");
                ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "mail:",string,"next", "exit");
            }
            else
            {*/
                if(strcmp(PlayerInfo[playerid][mail], inputtext, true, 129) == 0)
                {
                    format(string, sizeof(string), "[TNW] write your pass");
                    ShowPlayerDialog(playerid, LOGIN2, DIALOG_STYLE_PASSWORD,"contraseсa:",string,"next","exit");
                }
                else
                {
                    SendClientMessage(playerid, -1, "[TNW] Error incorrect mail.");
                    format(string, sizeof(string), "[TNW] Error invalid mail.");
                    ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "mail:",string,"next", "exit");
                }
            }
Reply
#3

Thanks bro, now it worked, Really thanks... emm could you teach me how it working?

Код:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
i wanna learn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)