18.05.2012, 16:45
anyone can login to any account with any password
pawn Код:
stock LoginPlayer(playerid,const password[])
{
new EscapedText[60];
new Query[128];
mysql_real_escape_string(password, EscapedText);
format(Query,sizeof(Query),"SELECT * FROM `Users` WHERE `Username` = '%s' AND `Password` = md5('%s')",GetName(playerid),EscapedText);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
SendClientMessage(playerid,COLOR_LIME,"You have been logged in!");
LoadStats(playerid);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Wrong password!");
Kick(playerid);
}
mysql_free_result();
return 1;
}