29.09.2013, 11:29
pawn Код:
format(Query, sizeof(Query), "SELECT 'password' FROM 'users' WHERE 'username' = '%s' LIMIT 0, 1", DB_Escape(GetName(playerid)));
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
db_get_field_assoc(Result, "ip", User[playerid][IP], 16);
db_get_field_assoc(Result, "password", User[playerid][Password], 129);
if((!strcmp(iP[playerid], User[playerid][IP], true)))
{
LoginPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,
"xPS : Login", ""white"Welcome back to "#SERVER_NAME"\nYou cannot play the game if you don't login, Here's some several reasons:\n"red"• "white"Your stats will not save\n"red"• "white"To avoid ban evade!\n\n"red"NOTE: "white"If this is not your account, Please left the server and use another username!\n\nPlease input your account's password!", "Login", "");
}
}
Also make sure that the query's lenght is enough in OnPlayerDisconnect.