My password is 123 but it also accepts 12?
#1

Why does it think 12 is a good password while my pass is 123?

Код:
case DIALOG_LOGIN:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                new name[MAX_PLAYER_NAME];
				GetPlayerName(playerid, name, sizeof(name));
                if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoneyEx(playerid, PlayerInfo[playerid][pCash]);
                    new plrIP[16];
    				GetPlayerIp(playerid, plrIP, sizeof(plrIP));
                    welcome(playerid);
                    NewMoney[playerid] = GetPlayerMoney(playerid);
                    PlayerInfo[playerid][pLogged] = 1;
                    ForceClassSelection(playerid);
				    TogglePlayerSpectating(playerid, true);
				    TogglePlayerSpectating(playerid, false);
	    			printf("%s logged in with IP: %s", name, plrIP);
                }
                else
                {
					slowkick(playerid, "Invalid password");
					PlayerInfo[playerid][pLogged] = 0;
                }
                return 1;
            }
        }
Reply
#2

Anyone?
Reply
#3

Have you declared you pPass as string or integer?
Do you mind showing the PlayerInfo enum?
Reply
#4

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
Have you declared you pPass as string or integer?
Do you mind showing the PlayerInfo enum?
Quote:

enum pInfo
{
pPass,
pCash,
pBank,
pAdmin,
pKills,
pDeaths,
pGroup,
pGroupRank,
pLogged
}
new PlayerInfo[MAX_PLAYERS][pInfo];

Stored as a string
Reply
#5

pawn Код:
pPass[32],
Reply
#6

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
pawn Код:
pPass[32],
Ye that ^
And everywhere replace PlayerInfo[playerid][pPass] with. PlayerInfo[playerid][pPass][32]
Reply
#7

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
pawn Код:
pPass[32],
That didn't fix it
Reply
#8

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
Ye that ^
And everywhere replace PlayerInfo[playerid][pPass] with. PlayerInfo[playerid][pPass][32]
That also does not fix it
Reply
#9

change

pawn Код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))
to

pawn Код:
if(!strcmp(inputtext, PlayerInfo[playerid][pPass]))
Reply
#10

pawn Код:
enum pInfo
{
pPass,
This is being created as an integer. Therefore, you have been saving, loading and modifying this variable as an integer and not a string. You need to alter everything to do with this variable to make sure it is being treated as a string. Also make sure you hash your passwords...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)