problem with ondialogresponse and inputtext with password...
#1

hey guys,

i was making this:
pawn Код:
if(dialogid == DIALOG_NIELSPASSWORD)
    {
        if(response)
        {
            if(strcmp(inputtext, "chilltime"))
            {
                CallElevator(playerid, 19);
            }
            else return ShowPlayerDialog(playerid, DIALOG_NIELSPASSWORD, DIALOG_STYLE_PASSWORD, "Please enter the Password", "This Floor belongs to Niels and requires a password\nYou entered the wrong Password!\nPlease try again or press Cancel", "Enter", "Cancel");
        }
        else if(!response)
        {
            ShowElevatorDialog(playerid);
        }
        return 1;
    }
but now when i go to the elevator, select the right floor, it DOES gives me the dialog for the password, but i can enter ANYTHING, everything you enter works, like when i type asdasdwafasf, then it say accepted and it works, but it only should work for the password "chilltime" and nothing else...

anyone sees wut i do wrong here?

greets niels
Reply
#2

You need this:

pawn Код:
if(strcmp(inputtext, "chilltime") == 0)
because Strcmp returns ZERO when the strings are the same.

Also you may want to use the 3rd parameter of Strcmp which is ignorecase as it's a password dialog box. For more info about Strcmp: https://sampwiki.blast.hk/wiki/Strcmp.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)