format(dat, sizeof(dat), "SELECT * FROM `User` WHERE `Name`='%s'", name);
mysql_query(dat);
mysql_store_result();
if(!mysql_num_rows())
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Registration", "Welcome to [HSA]Sgt's SA Heaven!\r\n\
As your name is not registered in our Database yet, you\r\nhave to register before you can start playing.\r\n\
Please enter the password you want to use below.\r\nIf you'd like to take another name click \"Quit\"", "Continue", "Quit");
}else{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Welcome Back to [HSA]Sgt's SA Heaven!\r\n\
Your username is already registered in the HSA DataBase,\r\ntherefore please enter your password below\r\n\
to start playering.\r\nIf this is not your account use\"Quit\" and take another name.", "Login", "Quit");
}
mysql_free_result();
new dat[500], string[256], date[50], day, month, year, ip[40], tmp[50];
GetPlayerName(playerid, name, sizeof(name));
format(dat, sizeof(dat), "SELECT * From `User` WHERE `Name`='%s' AND `Password`='md5('%s')", name, inputtext);
mysql_query(dat);
mysql_store_result();
if(mysql_num_rows())
{
mysql_get_field("Level", tmp);
PlayerData[playerid][Level] = strval(tmp);
mysql_get_field("Score", tmp);
SetPlayerScore(playerid, strval(tmp));
mysql_get_field("Money", tmp);
SetPlayerMoney(playerid, strval(tmp));
GetPlayerIp(playerid, ip, sizeof(ip));
getdate(year, month, day);
format(date, sizeof(date), "%d/%d/%d", day, year, month);
format(dat, sizeof(dat), "UPDATE `User` SET `LoginDate`='%s', `LoginIP`='%s' (WHERE `Name=`='%s')", date, ip, name);
mysql_query(dat);
if(mysql_num_rows() >= 1){
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Welcome Back to [HSA]Sgt's SA Heaven!\r\n\
Your username is already registered in the HSA DataBase,\r\ntherefore please enter your password below\r\n\
to start playering.\r\nIf this is not your account use\"Quit\" and take another name.", "Login", "Quit");
}else
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Registration", "Welcome to [HSA]Sgt's SA Heaven!\r\n\
As your name is not registered in our Database yet, you\r\nhave to register before you can start playing.\r\n\
Please enter the password you want to use below.\r\nIf you'd like to take another name click \"Quit\"", "Continue", "Quit");
}
if(!mysql_num_rows())
{
//register
}
else
{
//login
}
mysql_free_result();

|
it's written in the first code line lol
![]() format(dat, sizeof(dat), "SELECT * FROM `User` WHERE `Name`='%s'", name); well I guess the probleme is no the connection... in the mysql log it says: CMySQLHandler::Connect() - Access denied for user 'sgtadmin_hsabot@'@'lizard.serverffs.com' (using password: YES) (Error ID: 1045) however I'm entered this: #define SQL_USER "sgtadmin_hsabot@sgt-site.tk" |