23.04.2016, 08:26
(
Последний раз редактировалось Logic_; 23.04.2016 в 08:33.
Причина: fixed some shitty mistakes, young ladies.
)
++ EDIT: check Andy's tut (https://sampforum.blast.hk/showthread.php?tid=597639) and mine too (https://sampforum.blast.hk/showthread.php?tid=602819)
At the top most of your script, right under the includes, put the native given below as there is no Whirlpool include but only a plugin.
Put this right under the register dialog
put this right under the login dialog
At the top most of your script, right under the includes, put the native given below as there is no Whirlpool include but only a plugin.
PHP код:
native WP_Hash(buffer[], len, const str[]);
PHP код:
WP_Hash(PlayerInfo[playerid][Key], 129, inputtext); // hashing it!
new INI:file = INI_Open(UserPath(playerid)); //opening the file
.....
INI_WriteString(file, "Key", PlayerInfo[playerid][Key]); //write the hashed string
.....
INI_Close(file); // close the file.
..... // these naughty kids (dots) means etc stuff
PHP код:
new hashpass[129]; // new string variable!
WP_Hash(hashpass, sizeof(hashpass), inputtext); //hashing the inputted text
if(!strcmp(hashpass, PlayerInfo[playerid][Password])) // if the password matches
{
............... // bla bla bla your login system stuff
}
else
{
..............// bla bla if the password is wrong
}