Textdraw special character Password
#1

Hello! I created a textdraw for login and after the player types his password, I want to show the textdraw with those characters, like in the DIALOG_STYLE_PASSWORD.Is it possible?

Reply
#2

Well, you can just set a fake textdraw with • as characters (you can just copy-paste that but can also create it with Alt+7) or you can make a simple script to count the dialog input and set the characters count, like example:

pawn Код:
new final[30];
    new first[30];
   
    new x[20] = "just test";
    new character[3];
    format(character, 3, "*");
   
    new y = strlen(x);
   
    for(new i = 0; i < y; i++)
    {
        format(first, 30, "%s", character);
        strcat(final, first);
    }
    printf("Number of symbols hidden: %d", y);
    printf("This shall be final result: %s", final);
I worked around with that code for you and seems to be working pretty well. It will convert the input code into stars (*) and you can set that as a string for your textdraw.

Код:
[23:45:13] Number of symbols hidden: 9
[23:45:13] This shall be final result: *********
That's the output. If you got something you don't understand, just ask me and I'll answer you.
Reply
#3

Yeah, it's possible.

[ame]http://www.youtube.com/watch?v=1TDg17ysmY0[/ame]
Reply
#4

Quote:
Originally Posted by Private200
Посмотреть сообщение
Well, you can just set a fake textdraw with • as characters (you can just copy-paste that but can also create it with Alt+7) or you can make a simple script to count the dialog input and set the characters count, like example:

pawn Код:
new final[30];
    new first[30];
   
    new x[20] = "just test";
    new character[3];
    format(character, 3, "*");
   
    new y = strlen(x);
   
    for(new i = 0; i < y; i++)
    {
        format(first, 30, "%s", character);
        strcat(final, first);
    }
    printf("Number of symbols hidden: %d", y);
    printf("This shall be final result: %s", final);
I worked around with that code for you and seems to be working pretty well. It will convert the input code into stars (*) and you can set that as a string for your textdraw.

Код:
[23:45:13] Number of symbols hidden: 9
[23:45:13] This shall be final result: *********
That's the output. If you got something you don't understand, just ask me and I'll answer you.
Wow, what a bunch of code for something that could be written in two lines.
PHP код:
for(new istrlen(pass); ji++)
    
pass[i] = '*'
Reply
#5

if(udb_hash(inputtext) == PlayerInfo[playerid][pPass] && strlen(inputtext) > 0)
{
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)