Pawno has stopped working..
#10

You must use strcmp to compare strings...
Also you used WP_Hash wrongly...
pawn Код:
if(WP_Hash(inputtext) != tmp)//Wrong
pawn Код:
new buffer[129];
WP_Hash(buffer,sizeof(buffer),inputtext);
//.....
if(strcmp(buffer,tmp,false))//No need to be case insensitive because Whirlpool always outputs capital characters.This can make the check faster.
//...
Second,shouldn't the password be a string?
pawn Код:
new tmp;//:/
tmp = INI_Int(file, "Password");//Use the function to read string
Also, in the first post I found that you missed a closing brace.
pawn Код:
else if(dialogid == 2)//Using else if is faster,as it doesn't need to check the dialogid again when dialogid is 1.
    {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid,name,sizeof(name));
        format(file,sizeof(file),SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
        new tmp;
        tmp = INI_Int(file, "Password");
        if(WP_Hash(inputtext) = !tmp) {
            SendClientMessage(playerid,red,"ERROR: Wrong Password!");
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "You are registered", "Type your password below", "Login", "Quit");
        }
        else
        {
            PInfo[playerid][Logged] = 1;
            PInfo[playerid][Level] = INI_Int(file,"Level");
            SetPlayerScore(playerid,PInfo[playerid][Score]);
            GivePlayerMoney(playerid,PInfo[playerid][Cash]);
            SendClientMessage(playerid,limegreen,"You have successfully logged in!");
        }//Here
    }
Reply


Messages In This Thread
Pawno has stopped working.. - by Snipa - 22.02.2011, 23:49
Re: Pawno has stopped working.. - by Hashski - 22.02.2011, 23:59
Re: Pawno has stopped working.. - by Snipa - 23.02.2011, 00:05
Re: Pawno has stopped working.. - by Hashski - 23.02.2011, 00:13
Re: Pawno has stopped working.. - by Snipa - 23.02.2011, 00:35
Re: Pawno has stopped working.. - by Serbish - 23.02.2011, 01:03
Re: Pawno has stopped working.. - by Snipa - 23.02.2011, 01:14
Re: Pawno has stopped working.. - by Serbish - 23.02.2011, 01:26
Re: Pawno has stopped working.. - by Snipa - 23.02.2011, 01:37
Re: Pawno has stopped working.. - by leong124 - 23.02.2011, 03:37

Forum Jump:


Users browsing this thread: 4 Guest(s)