20.03.2011, 09:54
I have this code to login, but even if he gets the password wrong it says "You successfully logged in"
I can't get it why?
I can't get it why?
pawn Код:
if(dialogid == Logindialog)
{
if(!response) return Kick(playerid) && SendClientMessage(playerid,red,"Have it you're way");
new string[200];
format(Query, sizeof(Query), "SELECT * FROM `Accounts` WHERE `Username` = '%s' AND `Password` = '%s'",
GetPName(playerid),
inputtext);
mysql_query(Query);
if(!mysql_num_rows())
{
PInfo[playerid][Failedlogins] ++;
format(string,sizeof(string),""lred"You have failed %i/3 times you're login \n"lwhite"Hey "lgreen"%s"lwhite", you're account is registered \n"lwhite"Please enter a password to continue\n"lwhite"Or press cancel to "lred"leave",PInfo[playerid][Failedlogins],GetPName(playerid));
ShowPlayerDialog(playerid,Logindialog,1,"Login",string,"Ok","Cancel");
if(PInfo[playerid][Failedlogins] == 3)
{
format(string,sizeof(string),"||- Announcement: %s has failed 3 times login and has been kicked -||",GetPName(playerid));
Kick(playerid);
SendAdminMessage(white,string);
}
return 1;
}
SendClientMessage(playerid,yellow,"You have successfully logged in!");
}