This allows me to enter without entering a password. Checking if it's null?
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(response == 0)
        {
            Kick(playerid);
        }
        else
        {
            new query[256], password[128];
            format(query, sizeof(query), "SELECT `Password` FROM `accounts` WHERE id = %d", PlayerSQLID[playerid]);
            mysql_query(query);
            mysql_store_result();
            mysql_fetch_row(password);
            mysql_free_result();
            new string[300];
            format(string, sizeof(string), "Welcome to %s\n\nYou entered a wrong password, please try again:", HOSTNAME);
            if(isnull(password))return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Please retry your password", string, "Login", "Leave");
            if(strcmp(password, inputtext, false) == 0)
            {
Title says all!

Thanks for any assistance.
Reply
#2

RESOLVED.
Reply
#3

Yes, strcmp returns 0 when both strings match OR if either of the strings is empty, for future reference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)