SA-MP Forums Archive
Dialog text - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog text (/showthread.php?tid=237785)



Dialog text - sim_sima - 10.03.2011

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.


Re: Dialog text - Calgon - 10.03.2011

Add

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



Re: Dialog text - Gertin - 10.03.2011

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


Re: Dialog text - sim_sima - 10.03.2011

yea, thats what i wanna know


Re: Dialog text - Calgon - 10.03.2011

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


Re: Dialog text - sim_sima - 10.03.2011

Yea, thanks.