26.05.2013, 11:21
Hey guys,
I have a problem with my Auto - login because it not working. Here is the code, I would really appreciate it, if someone would help me:
The auto - login code is there.
Please help! Thanks
I have a problem with my Auto - login because it not working. Here is the code, I would really appreciate it, if someone would help me:
pawn Код:
new
pname[24];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT IP FROM `playerdata` WHERE user = '%s' LIMIT 1", pname);
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
if(!rows)
{
new
rDialog[500];
format(rDialog, sizeof(rDialog), "{92FF4F}Welcome to {7069FF}Los Santos Life CnR, {FFFFFF}%s.\n\n{FFFFFF}You are not yet registered. \n{FFFFFF}Please register an account by typing in a desired password below! \n\n{F81414}Please note: \n{F81414}-{FFFFFF} Your password must contain atleast 1 character. \n{F81414}-{FFFFFF} Your password may not contain more than 20 characters. \n{F81414}-{FFFFFF} Strong password contain atleast 2 numbers.", GetName(playerid));
ShowPlayerDialog(playerid, 15000, DIALOG_STYLE_PASSWORD, "{F81414}Registration", rDialog,"Register","Cancel");
}
if(rows == 1)
{
new IP[2][16];
mysql_fetch_field_row(IP[0],"IP");
GetPlayerIp(playerid, IP[1], 16);
if(strlen(IP[0]) != 0 && !strcmp(IP[0], IP[1], true))
{
MySQL_Login(playerid);
}
else if(!strlen(IP[0]) || strcmp(IP[0], IP[1], true))
{
new
rDialog[500];
format(rDialog, sizeof(rDialog), "{92FF4F}Welcome to {7069FF}Los Santos Life CnR, {FFFFFF}%s. \n\n{FFFFFF}This username is already {F81414}registered{FFFFFF}. \n{FFFFFF}Please login to your account by typing in your password below!\n\n{F81414}Do not: \n{F81414}-{FFFFFF} Attempt to login if this is not your account. \n{F81414}-{FFFFFF} Lie to Administrators claiming this is your account, when it is not.", GetName(playerid));
ShowPlayerDialog(playerid, 15500, DIALOG_STYLE_PASSWORD, "{00FF22}Login", rDialog,"Login","Cancel");
IsRegistered[playerid] = 1;
}
Please help! Thanks