A simple mysql help
#1

Hello, i've been making my gm into R33 but i'm stuck into some part below
The code below is a tut which i've been using to convert the gm, in this there is a Variable for storing password and it is hashed using whirlpool but in my current gamemode i hashed it using SHA1 and doesn't have a variable to store it
But for converting my old script to this i should make a variable (for password) and hash the password with whirlpool, i cannot do that as my users are registered under SHA1.
accoring to this code below it needs password variable and wp hashin, so could anyone please help me to convert it as it is a few lines
pawn Код:
//this checks in the dialog for player password
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass, PlayerInfo[playerid][Password], false))
{
    new str2[128];
    mysql_format(MySQL, str2, 128, "SELECT * FROM `players` WHERE user = '%e' LIMIT 1", GetName(playerid));
    mysql_tquery(MySQL, str2, "LoadAccount", "i", playerid);
}
This was my R5 code used as a dialog to login (which was working fine)

pawn Код:
//mysql r5 dialog check
new query[200], pname[24], escapepass[100];
GetPlayerName(playerid, pname, 24);
mysql_real_escape_string(inputtext, escapepass);
format(query, sizeof(query), "SELECT `user` FROM players WHERE user = '%s' AND password = SHA1('%s')", pname, escapepass);
mysql_query(query);
mysql_store_result();
new numrows = mysql_num_rows();
if(numrows == 1) MySQL_Login(playerid);
Reply
#2

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)