01.12.2012, 12:47
Try this.
pawn Код:
stock LogMeIn(playerid,const password[])
{
new EscapedText[60], Query[80], pName[24];
GetPlayerName(playerid,pName,sizeof(pName));
mysql_real_escape_string(password, EscapedText);
format(Query,sizeof(Query),"SELECT * FROM `users` WHERE `name` = '%s' AND `pass` = '%s'",pName,EscapedText);
mysql_query(Query);
mysql_store_result();
if(!strlen(password))
{
ShowPlayerDialog(playerid, Valepass, DIALOG_STYLE_PASSWORD, "Wrong password!", "Wrong password!", "Login", "Leave");
return 0;
}
if(mysql_num_rows() != 0)
{
SendClientMessage(playerid,yello2,"U've just log'd in!");
LoadStats(playerid);
}
else
{
ShowPlayerDialog(playerid, Valepass, DIALOG_STYLE_PASSWORD, "Wrong password!", "Wrong password!", "Login", "Leave");
}
mysql_free_result();
return 1;
}