SA-MP Forums Archive
[HELP] Security Password InPut - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Security Password InPut (/showthread.php?tid=388853)



[HELP] Security Password InPut - CrusherCpt - 30.10.2012

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


AW: [HELP] Security Password InPut - Skimmer - 30.10.2012

Why you don't use strcmp();

https://sampwiki.blast.hk/wiki/Strcmp


Re: [HELP] Security Password InPut - CmZxC - 30.10.2012

DIALOG_STYLE_PASSWORD


Re: [HELP] Security Password InPut - CrusherCpt - 30.10.2012

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

Thanks


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


Re: [HELP] Security Password InPut - RedFusion - 30.10.2012

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


Re: [HELP] Security Password InPut - CrusherCpt - 31.10.2012

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

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