Login trouble.
#4

This should work
pawn Код:
case DIALOG_REGISTER:
            {
                if(response)
                {
                   if(!strlen(inputtext))
                    {
                        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{00FFFF}Register", "{00FFFF}Please enter your password to register.\n{FF0000}You can't leave this empty.", "OK", "Cancel");
                        return 1;
                    }
                    new INI:file = INI_Open(Path(playerid));
                    INI_WriteString(file,"Password",inputtext);
                    INI_SetTag(file, "[Player Stats]");
                    INI_WriteInt(file,"Score",0);
                    INI_WriteInt(file,"Deaths",0);
                    INI_WriteInt(file,"Admin",0);
                    INI_WriteInt(file,"Gmute", 0);
                    INI_WriteInt(file,"Vip", 0);
                    INI_WriteInt(file,"Hunger", 100);
                    INI_WriteInt(file,"Thirst", 100);
                    INI_WriteInt(file,"Health", 100);
                    INI_WriteInt(file,"Backpack", 8);
                    INI_Close(file);
                    TextDrawHideForPlayer(playerid, Loading);
                    return 1;
                }
                else Kick(playerid);
            }
            case DIALOG_LOGIN:
            {
                if(response)
                {
                    if(!strcmp(inputtext, pStats[playerid][password], false))
                    {
                        INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
                        SendClientMessage(playerid,COLOR_WHITE,"You have successfully logged in.");
                        TextDrawHideForPlayer(playerid, Loading);
                    }
                    else
                    {
                        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "{00FFFF}Please enter your password to login.\n{FF0000}Incorrect password.", "OK", "Cancel");
                        TextDrawHideForPlayer(playerid, Loading);
                        return 1;
                    }
                }
                else Kick(playerid);
Reply


Messages In This Thread
Login trouble. - by [WA]iRonan - 31.12.2013, 14:03
Re: Login trouble. - by EiresJason - 31.12.2013, 14:04
Re: Login trouble. - by [WA]iRonan - 31.12.2013, 14:07
Re: Login trouble. - by Wizza - 31.12.2013, 14:18
Re: Login trouble. - by [WA]iRonan - 31.12.2013, 15:26
Re: Login trouble. - by EliteApple - 31.12.2013, 19:11
Re: Login trouble. - by PrivatioBoni - 31.12.2013, 19:46
Re: Login trouble. - by [WA]iRonan - 01.01.2014, 19:16

Forum Jump:


Users browsing this thread: 1 Guest(s)