[HELP] Security Password InPut
#1

Hi, im trying to make a kind of security password type sistem in my GM..
I'll explain.. When the player tipes the password it apears "Black Balls" instead of the real password..

Is it possible?

Here's the Dialog

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(response)
            {
                new
                    strText[179], naslov2[128];

                if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)
                {
                    OnPlayerRegister(playerid, inputtext);

                    format(strText, 125, "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}, you are automatic logged in!", GetName(playerid), inputtext);
                    SendClientMessage(playerid, 0xFF8000AA, strText);
                }
                else
                {
                    format(naslov2, sizeof(naslov2), "     Welcome %s!", GetName(playerid));
                    format(strText, 179, "______________________________\n\nName %s isn't registered!\n\nPassword must be between 4 and 35 characters!", GetName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, naslov2, strText, "Register", "Exit");
                }
            }
            else Kick(playerid);
        }

        case DIALOG_LOGIN:
        {
            if(response)
            {
                new
                    strText[179], naslov2[128];

                if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)
                {
                    OnPlayerLogin(playerid, inputtext);
                }
                else
                {
                    format(naslov2, sizeof(naslov2), "     Welcome %s!", GetName(playerid));
                    format(strText, 179, "______________________________\n\nName %s is registered!\n\n{F81414}You typed wrong password!", GetName(playerid));
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, naslov2, strText, "Login", "Exit");
                }
            }
            else Kick(playerid);
        }
    }

    return 1;
}
If you know how to do, please explain.. Don't just paste de code :P
Reply
#2

Why you don't use strcmp();

https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

DIALOG_STYLE_PASSWORD
Reply
#4

DIALOG_STYLE_PASSWORD
--" and I only learned 3 dialog styles :P

Thanks


What's the difrence between strcmp() and YCMD? YCMD is faster..
Reply
#5

strcmp can be used for other things than commands, YCMD cannot.
Strcmp is made for comparing strings String Compare
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=290132

There's still sscanf :P
I'm already familiar with the YMCD, CMD, ZCMD :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)