10.03.2011, 12:00
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.
Hope someone can tell me how. Thank you.
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);
}
}