Get 'false password' error eventhough password is correct
#1

I put the correct pass but still it throws the error, why?

Code:
case DIALOG_LOGIN:
        {
            if (!response) return Kick ( playerid );
            if(response)
            {
                if(strcmp(inputtext, PlayerInfo[playerid][pPass], false))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoneyEx(playerid, PlayerInfo[playerid][pCash]);
                    welcome(playerid);
                    NewMoney[playerid] = GetPlayerMoney(playerid);
                    PlayerInfo[playerid][pLogged] = 1;
                    ForceClassSelection(playerid);
				    TogglePlayerSpectating(playerid, true);
				    TogglePlayerSpectating(playerid, false);
                }
                else
                {
					slowkick(playerid, "Invalid password");
					PlayerInfo[playerid][pLogged] = 0;
                }
                return 1;
            }
        }
Reply
#2

if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))

This will fix it.
Strcmp returns 0 when both strings match, that's why you put '!'
Reply
#3

Quote:
Originally Posted by DavidBilla
View Post
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))

This will fix it.
Strcmp returns 0 when both strings match, that's why you put '!'
Thank I shouldve known
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)