30.12.2013, 11:56
Hey, i've been wanting to switch to Whirlpool, but i have no idea to do that, even though i looked at many tutorials.
This is my code
And i would like to make this line into whirlpool
This is my code
pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
new Query[300];
mysql_real_escape_string(pInfo[playerid][Nick], pInfo[playerid][Nick]);
// escaping the name of the player to avoid sql_injections.
mysql_real_escape_string(pInfo[playerid][IP], pInfo[playerid][IP]);
// escaping the IP of the player to avoid sql_injections.
// as you might've seen we haven't escaped the password here because it was already escaped in our register dialog
format(Query, sizeof(Query), "INSERT INTO `playerdata` (`nick`, `password`, `ip`) VALUES('%s', '%d', '%s')", pInfo[playerid][Nick], udb_hash(passwordstring), pInfo[playerid][IP]); // Here we use the INSERT option and insert the name, password, and ip of the player in the database.
// we don't insert the score, admin, or any other variable because its automatically 0.
mysql_query(Query);
// here we do not need to mysql_store_result or mysql_free_result
// because we are only inserting data in the database not selecting it
//next we set the players logged variable to 1.
//and the isregistered variable to 1 aswell.
SendClientMessage(playerid, -1, "You have now been successfully registered on this server!");
pInfo[playerid][Logged] = 1; //Sets the login variable to 1, meaning logged in.
pInfo[playerid][IsRegistered] = 1; // sets the registered variable to 1. meaning registered. return 1;
}
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `playerdata` (`nick`, `password`, `ip`) VALUES('%s', '%d', '%s')", pInfo[playerid][Nick], udb_hash(passwordstring), pInfo[playerid][IP]); // Here we use the INSERT option and insert the name, password, and ip of the player in the database.