Posts: 186
Threads: 36
Joined: Dec 2017
guys i m working on sqlite gmemode but i wanna remove wp_hash to <dutils>(num_hash)
so how can i do it help please
Код:
new buf[129];
WP_Hash(buf, 129, inputtext);
if(!strcmp(buf, User[playerid][Password], false))
{
etc
etc
etc
etc
etc
return 1;
}
Posts: 1,176
Threads: 2
Joined: Nov 2012
Reputation:
0
// remove this new buf[129];
// remove this WP_Hash(buf, 129, inputtext);
if(!strcmp(inputtext, User[playerid][Password], false)) // edit this buf to inputtext, like this <--
{
Posts: 186
Threads: 36
Joined: Dec 2017
Quote:
Originally Posted by Mugalito
// remove this new buf[129];
// remove this WP_Hash(buf, 129, inputtext);
if(!strcmp(inputtext, User[playerid][Password], false)) // edit this buf to inputtext, like this <--
{
|
i changed it here
that to
Код:
//Login Dialog
if(num_hash(inputtext) == User[playerid][Password])
{
but when i register how should i use it here
Код:
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!IsValidPassword(inputtext))
{
SendClientMessage(playerid, -1, ""chat" "COL_RED"The password is invalid, Valid characters are: A-Z, a-z, 0-9");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SERVER NAME"COL_WHITE" Register pannel", ""chat" Please register to play on "COL_BLUE"SERVER NAME\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit");
return 1;
}
if(strlen(inputtext) < 3 || strlen(inputtext) > 24)
{
SendClientMessage(playerid, -1, ""chat" "COL_RED"The password is invalid, Its lenght should be 3-24 characters");
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SERVER NAME"COL_WHITE" Register pannel", ""chat" Please register to play on "COL_BLUE"SERVER NAME\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit");
return 1;
}
new Query[208];
format(Query, sizeof(Query), "INSERT INTO users (username, password) VALUES ('%s', '%s')", DB_Escape(User[playerid][UserName]), User[playerid][Password] == num_hash(inputtext));//DB_Escape(User[playerid][Password]),num_hash(inputtext));
db_query(Database, Query);
User[playerid][Logged] = true;
SendClientMessage(playerid, 0x00FF00FF, ""chat" "COL_LIGHTBLUE"You have just registered to our server! You have been automatically logged in!");
}
else Kick(playerid);
return 1;
}
Posts: 1,176
Threads: 2
Joined: Nov 2012
Reputation:
0
User[playerid][Password] == inputtext;
Posts: 1,176
Threads: 2
Joined: Nov 2012
Reputation:
0
you have to use same code without hash.
Posts: 186
Threads: 36
Joined: Dec 2017
your way not worked i fixed it myself
Solved