Password
#1

fixed
Reply
#2

- Messed it up, nevermind -
Reply
#3

Quote:
Originally Posted by Private200
Посмотреть сообщение
Try deleting the WB_Hash from your native and then use this instead:

pawn Код:
stock WP_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;
}
Place it wherever at your script. After it, try using this as script.

pawn Код:
if(strlen(inputtext) >= 5 && strlen(inputtext) <= 20)
                {
                    new WPHash[129];
                    WP_Hash(WPHash, sizeof(WPHash), inputtext);
                    new INI:playerFile = INI_Open(UserPath(playerid));
                    INI_SetTag(playerFile, "statistics");
                    INI_WriteString(playerFile, "Password", WP_Hash(inputtext));
                    INI_WriteInt(playerFile, "Admin", 0);
                    INI_WriteInt(playerFile, "Kills", 0);
                    INI_WriteInt(playerFile, "Deaths", 0);
                    INI_WriteInt(playerFile, "Money", 0);
                    INI_Close(playerFile);
                   
                    format(dString, sizeof(dString), "Uspjeљno ste se registrirali pod imenom "CWHITE"'%s' "CRED"i lozinkom "CWHITE"'%s'"CRED". Zahvaljujemo na registracij!", GetName(playerid), inputtext);
                    SendClientMessage(playerid, RED, dString);
                }
AND after replacing that code with your REGISTER section, use this also:

pawn Код:
if(WP_Hash(inputtext) == PlayerInfo[playerid][Password])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
So, you shall remove this code from the LOGIN section:

pawn Код:
new WPHash[129];
                WP_Hash(WPHash, sizeof(WPHash), inputtext);
                if(!strcmp(WPHash, PlayerData[playerid][Password], false))
                {
                    INI_ParseFile(UserPath(playerid), "user_%s", .bExtra = true, .extra = playerid);
                }
Also, wherever you use the 'WPHash', don't add anything like 'new WPHash[129]' or anything else, you shall simply use the 'WP_Hash(inputtext)' and you're ready to go. Easier for you, so you don't have to edit anything else.

I think there shall be some warnings because you haven't deleted the unused functions, (new WPHash) etc. Just try to fix them, if you can't, post here.
You're being serious? WP Hash = Whirpool and that stock is udb_hash which came from dudb, Download the latest Whirpool plugin
Reply
#4

Is there any password listed in your ini file? Anyway, why do you guys talk about Whirlpool?

Honestly: I've never been familar with ini.
Reply
#5

I have this one https://sampforum.blast.hk/showthread.php?tid=65290 is this the latest or ?
Reply
#6

Yeah, that's the one i use atleast. But does it even save any password?
Reply
#7

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
Yeah, that's the one i use atleast. But does it even save any password?
Yes he save password
Reply
#8

Does it show the password you entered or just a bunch of characters?
Reply
#9

Код:
[statistics]
Password = 2F0D1903FA0D5192AADFC65819E1DA61DBB8762E73853283A820132802B2B5D44FBB29DB3EA0AA62DCE2919F2E9039765D835DE8966F1778DBDFF3B7B79A322E
Admin = 0
Kills = 0
Deaths = 0
Money = 0
but i can enter with any other password
Reply
#10

Then you must look at the loading part of the password. See if you did anything wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)