28.11.2011, 19:17
The unban command itself works fine, it gets deleted from the database.
However, the reason, date + IP does not display (It's saved properly in the database, as i see it in PHPMyAdmin fine.)
What have i done wrong?
However, the reason, date + IP does not display (It's saved properly in the database, as i see it in PHPMyAdmin fine.)
What have i done wrong?
pawn Код:
new checkquery2[128];
format(checkquery2, sizeof(checkquery2), "SELECT `Username` FROM `bans` WHERE `Username` = '%s'", tmp);
mysql_reconnect();
mysql_query(checkquery2);
mysql_store_result();
if(mysql_num_rows() > 0) //BANNED
{
new line[500];
if(mysql_fetch_row(line)) //Fetches the line
{
new data[5][128]; //The data strings
sscanf(line, "p<|>sssss", data[0], data[1], data[2], data[3], data[4]); //Splits the line with sscanf
format(string, sizeof(string), "You have unbanned the player {1B8AE4}%s(%s)", tmp, data[3]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,sizeof(string), "[Ban Details] Banned by {1B8AE4}%s {FFFFFF}• {1B8AE4}[Reason: %s] {FFFFFF}at {1B8AE4}[%s]", data[2], data[1], data[4]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string,sizeof(string), "Admin %s has unbanned %s [Banned by: %s, reason: %s]", PlayerName(playerid), tmp, data[2], data[4]);
ABroadCast(COLOR_ADMIN,string,1);
new deletequery2[128];
mysql_reconnect();
format(deletequery2, sizeof(deletequery2), "DELETE FROM bans WHERE Username = '%s'", tmp);
mysql_query(deletequery2);
mysql_free_result();
return 1;
}
mysql_free_result();