strcmp, wrong password...
#1

When I'm comparing the two strings it'n saying wrong password, even the password correct.
Password is hashed in player file.ini
pawn Код:
if(strcmp(hash(inputtext), pData[playerid][Password]) == 0)

// Loading player data
forward LoadUser_Data(playerid,name[],value[]);
public LoadUser_Data(playerid,name[],value[])
{
    INI_Int("Password",pData[playerid][Password]);
    INI_Int("Admin",pData[playerid][Admin]);
    INI_Int("Level",pData[playerid][Level]);
    INI_Int("Kills",pData[playerid][Kills]);
    INI_Int("Deaths",pData[playerid][Deaths]);
    return 1;
}
help please
Reply
#2

what kinda hash you using?

if its not a string hash then you wont need to use strcmp


pawn Код:
if(hash(inputtext) == pData[playerid][Password])
Reply
#3

this is string... password may contains letters/numbers..
Reply
#4

yes the inputtext is a string but what type does the hash return?
my guess is an int.!

and this was my hint
pawn Код:
INI_Int("Password",pData[playerid][Password]);
INI_Int is an int
otherwise it would be INI_String
Reply
#5

I'm using hash(inputtext) in dutils include I think..
Reply
#6

did you ever try what i suggested?
im sure youll find its a fix!

regards,
Reply
#7

Solved, I did 1 thing wrong, in load I writted INI_Int, I should writted INI_String, because my password it's string..
anyway +rep you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)