Login script bug
#1

So, using the help of the samp wiki, I've managed to make a login command-thingy. The problem is, when I press the login button when the "input box" is empty, it automatically refers it to me.
Here's the code:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(!response) // If they clicked 'Cancel' or pressed esc
        {
            SendClientMessage(playerid, 0xFF0000FF, "LOGIN FAILED.");
        }
        else // Pressed ENTER or clicked 'Login' button
        {
            if(VilcsiTHPassword(playerid, inputtext))
            {
                SendClientMessage(playerid, 0xFF0000FF, "You are now logged in as VilcsiTH!");
            }
            else
            if(SamuelPassword(playerid, inputtext))
            {
                SendClientMessage(playerid, 0xFF0000FF, "You are now logged in as Samuel!");
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000FF, "LOGIN FAILED.");

                // Re-show the login dialog
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Please enter your password:", "Login", "Cancel");
            }
        }
        return 1;
    }

    return 0;
}
Thanks for helping.
Reply


Messages In This Thread
Login script bug - by VilcsiTH - 08.06.2013, 16:27
Re: Login script bug - by gtakillerIV - 08.06.2013, 16:46
Re: Login script bug - by VilcsiTH - 08.06.2013, 19:15
Re: Login script bug - by SilverKiller - 08.06.2013, 20:19
Re: Login script bug - by VilcsiTH - 09.06.2013, 09:47

Forum Jump:


Users browsing this thread: 1 Guest(s)