Dialog text
#1

Hey guys.
I have made a login/register system for my server. Its using dialig (DIALOG_STYLE_INPUT).
I want to make, so the password cant be shorter than 5 letters, and not longer than 15 letters.
Anyone know how i can do that?

If you need to see some of my code, its here:
this is the 'register account' -dialog.
This is from the
"public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])" -callback.
pawn Код:
if(dialogid == 1)
    {
        new name[MAX_PLAYER_NAME], file[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), UserFile, name);
        if(response)
        {
            dini_Create(file);
            dini_IntSet(file, "Password", udb_hash(inputtext));
            dini_IntSet(file, "Money",PlayerInfo[playerid][pMoney] = 0);
            dini_IntSet(file, "Activity",PlayerInfo[playerid][pActivity] = 0);
            dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
            dini_IntSet(file, "Banned",PlayerInfo[playerid][pBanned] = 0);
            GameTextForPlayer(playerid, "Welcome", 3000, 5);
            gPlayerLogged[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_SYSTEMRED, "You need to login to play on this server. Please come again soon");
            Kick(playerid);
        }
    }
Hope someone can tell me how. Thank you.
Reply
#2

Add

pawn Код:
if(strlen(inputtext) <= 15 || strlen(inputtext) >= 5) return 1;
Reply
#3

Dialog works perfectly ? Only want to know, how to make that like 5-15 ?
Reply
#4

yea, thats what i wanna know
Reply
#5

I've given you the code to add... Add it to your dialog code!
Reply
#6

Yea, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)