Help - Change password
#1

Fixed.
Reply
#2

How is PlayerInfo[playerid][pPass] defined? Assuming it's correct, try using this:

pawn Код:
if(strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass], true)== 0)
Reply
#3

Quote:
Originally Posted by austin070
Посмотреть сообщение
How is PlayerInfo[playerid][pPass] defined? Assuming it's correct, try using this:

pawn Код:
if(strcmp(udb_hash(inputtext), PlayerInfo[playerid][pPass], true)== 0)
Wouldn't work. UBD hash is converted from a string to a number.
Reply
#4

Quote:
Originally Posted by Death1300
Посмотреть сообщение
Wouldn't work. UBD hash is converted from a string to a number.
Strcmp does not convert anything, it just checks to see if they match at the given points. Also, it's not a number, it's either an integer or float. UDB hash returns a number, but you could format it into a string if you needed to.

Make sure your UDB_HASH is like this.
pawn Код:
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
Reply
#5

Fixed.
Reply
#6

Show us your command, all of it.
Reply
#7

Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)