need help always wrong
#1

pawn Код:
public OnPlayerLogin(playerid,password[])
{
    new h_password[ 129 ];
    WP_Hash( h_password, sizeof ( h_password ), password );
    if(strcmp ( h_password, pData[ playerid ][ pPassword ] ) )
    {
        INI_ParseFile(UPath ( playerid ), "LoadUser_%s", .bExtra = true, .extra = playerid);
        SendClientMessage(playerid,C_GREEN,"Correct Password");
    }
    else
    {
        new dbug[500];
        format(dbug,sizeof(dbug),"Password %s [ %s ]",password,h_password);
       
        print(dbug); // thats for debuging
        SendClientMessage(playerid,C_RED,"Wrong Password");
        SPD(playerid,D_LOGIN,PASSWORD,""CSERVER"",""CWHITE"Please Enter Your Password   ToLogin","Proceed","Quit");
    }
    return 1;
}
I always got wrong password i need help
Reply
#2

You need to parse the file before you check for a password.
Reply
#3

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
You need to parse the file before you check for a password.
i already did but same thing nothing is working
Reply
#4

anyone its been an hour
Reply
#5

pawn Код:
if(strcmp ( h_password, pData[ playerid ][ pPassword ] ) )
should be

pawn Код:
if(strcmp ( h_password, pData[ playerid ][ pPassword ] ) == 0)
because strcmp returns 0 if the strings match and 1 if they don't match.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)