Player can register with no or short password help
#1

This code is supposed to show the dialog again if the player entered too short password but it aint working but no errors or warnings. Help? I guess its simple
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            new dialog[128];{
            if(inputtext[0] < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Password must be longer than 4 characters!", dialog, "Register", "Exit");}
            if(response)
            {

                new
                    string[179],pFile[35];

                    format(pFile, 35, Player_File, GetName(playerid));

                new
                    INI:UserFile = INI_Open(pFile);

                    INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
                    INI_WriteInt(UserFile, "Admin", 0);
                    INI_WriteInt(UserFile, "Money", START_MONEY);
                    INI_WriteInt(UserFile, "Score", 0);
                    INI_WriteInt(UserFile, "Skin", SKIN_ID);
                    INI_WriteInt(UserFile, "Warn", 0);
                    INI_WriteInt(UserFile, "VIP", 0);
                    INI_WriteInt(UserFile, "B_Time", 0);
                    INI_WriteInt(UserFile, "B_Till", 0);
                    INI_Close(UserFile);

                    SetPVarInt(playerid, "Registered", 1);
                    SetPVarInt(playerid, "Logged", 1);
                    SpawnPlayer(playerid);

                    format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
                    SCM(playerid, 0x46BA29FF, string);
                    ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"Rules","1.Cheating and hacking - Permban\n2./ask if you want help.\n3Disrespect will end in a ban.\nOnly English in chat.\nDifferent language in chat will end in ban.\n4.Respect All Players!","Agree","Deny");
                    SpawnPlayer(playerid);
            }
            else Kick(playerid);
        }
/// I didnt post the rest...
Reply
#2

pawn Код:
if(strlen(inputtext) < 5) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Password must be longer than 4 characters!", dialog, "Register", "Exit");}
Reply
#3

No it's still not showing the dialog if he doesn't type any password atall or too short.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)