login problem
#1

it's login system, it compile good but when i entered my password it enter even if it's wrong

sorry for my bad english

login dialog:
pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], Password[256], IP[16], Password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(Password2, sizeof(Password2), inputtext);
            format(Password, sizeof(Password), "%s", dini_Get(file, "Password"));
            if(strcmp(Password, inputtext,true))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
                SSSShowDialog(playerid, 2);
                return 1;
            }
            if(sscanf(inputtext, "s[128]", inputtext))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You must enter a password to procceed.");
                SSSShowDialog(playerid, 2);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                SendClientMessage(playerid, COLOR_LIME, "");
                format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
                GetPlayerIp(playerid, IP, sizeof(IP));
                dini_Set(file, "IP", IP);
                PlayerInfo[playerid][pSex] = dini_Int(file, "Sex");
                PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
                if(!PlayerInfo[playerid][pSex] || !PlayerInfo[playerid][pAge])
                {
                    SSSShowDialog(playerid, 3);
                }
                else
                {
                    LoadChar(playerid);
                    SpawnPlayer(playerid);
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to quit the server.");
            Kick(playerid);
        }
    }
Reply
#2

I can't believe that, no one can help me in that problem??
I think it's easy but not for me.
Reply
#3

Its saving on your LAST IP, if you change your IP, you have to enter the correct password
Reply
#4

can't understand, explain more please
Reply
#5

bumb
Reply
#6

Why don't you try to follow this Tutorial by Newbienoob or this Tutorial by Kush
Reply
#7

Dini is slower to read the player files. Y_ini much faster. Use Y_ini by kush, Don't forget to put the Ysi folder in include.
Reply
#8

Time to convert to y_ini my friend easy to learn and fast reading also who is kush?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)