//MYSQL//
stock mysql_CheckAccount(playerid)
{
new Query[128],Name[MAX_PLAYER_NAME],count;
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
mysql_real_escape_string(Name, Name);
format(Query, sizeof(Query), "SELECT * FROM `accounts` WHERE `Name` = '%s'", Name);
mysql_query(Query);
mysql_store_result();
count = mysql_num_rows();
mysql_free_result();
return count;
}
//MYSQL Accounterstellungs Stock//
stock CreateAccount(playerid, pass[])
{
new query[256],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
SetPlayerScore(playerid, 1);
mysql_real_escape_string(Name,Name);
mysql_real_escape_string(pass,pass);
format(query, sizeof(query), "INSERT INTO `accounts` (`Name`,`Passwort`) VALUES ('%s',MD5('%s'))", Name, pass);
mysql_query(query);
return true;
}
//Passwort MYSQL Stock//
stock mysql_ReturnPasswort(Name[])
{
new query[130], Get[130];
mysql_real_escape_string(Name, Name);
format(query, 128, "SELECT `passwort` FROM `accounts` WHERE `Name` = '%s'", Name);
mysql_query(query);
mysql_store_result();
mysql_fetch_row(Get);
mysql_free_result();
return Get;
}
Hier mal der stock, also wenn sich jemand registriert, wird dass Passwort MD5-Gehasht in meiner Datenbank gespeichert, aber sobald ich /GMX (Im Spiel) mache, oder die BATCH neu starte
Wird dem Spieler ausgegeben, dass das Passwort falsch wäre, jemand ne Idee?