10.04.2011, 10:58
Well if i put has inputtext Carrots2456 i want it to hash, but on mysql table it appears Carrots2456
pawn Код:
if(dialogid == Registerdialog)
{
new IP[56],buffer[200];
GetPlayerIp(playerid,IP,56);
format(string,sizeof(string),"%s,%s", dini_Get("aka.txt",IP), GetPName(playerid));
dini_Set("aka.txt", IP, string);
if(!response) return Showinfo2(playerid,"~g~Have fun!");PInfo[playerid][Logged] = 0;
if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid,Registerdialog,1,"Register",""lwhite"Put in a password to "lgreen"register","Ok","Cancel");Showinfo2(playerid,"~r~No password input!");
new query[720],ip[16];
GetPlayerIp(playerid,ip,sizeof(ip));
WP_Hash(buffer, sizeof(buffer), inputtext);
mysql_real_escape_string(GetPName(playerid),GetPName(playerid));
mysql_real_escape_string(inputtext,buffer);
format(query,sizeof(query),"INSERT INTO `Accounts` (`Username`, `Password`, `pip`, `Lvl`, `Money`, `Score`, `Language`) VALUES ('%s', '%s', '%s', 0, 0, 0, 0)",
GetPName(playerid),
buffer,
ip);
mysql_query(query);
PInfo[playerid][Logged] = 1;
Showinfo2(playerid,"~g~Successfully registered!");
mysql_query("SELECT * FROM `Accounts`");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
format(string,sizeof(string),"*** %s has registered on our server. There are now a total of {F5E400} %d{00C3FF} registered users!",GetPName(playerid),rows);
SendClientMessageToAll(0x00C3FFFF,string);
ShowPlayerDialog(playerid,Languagedialog,0,""lgreen"Language",""lgreen"Choose your "lyellow"language",""lred"English",""lgrey"Bulgarian");
}