28.08.2014, 04:13
Hey guys well im updating my server to R39 MySQL, and ban check is refusing to work. I put myself into bans in MySQL database, and the mysql seems to find me in there, but nothing happens. Heres my script:
this is the MySQL log:
I have no idea why the IP appears like that though. Cause i get it onplayerconnect, and save it into a string instantly that works all over the script. Anyone know why the script wouldnt get be as banned?
pawn Код:
stock CheckBans(playerid)
{
// Create variables
new
banned_pname[24],
MySQLQuery[255],
Year,
Month,
Day,
Hour,
Min,
Sec,
query[200];
new rows, fields;
getdate(Year, Month, Day);
gettime(Hour,Min,Sec);
GetPlayerName(playerid,banned_pname,sizeof(banned_pname));
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `banai` WHERE `Player` = '%s' OR `IP` = '%s'", banned_pname, IP[playerid]);
mysql_tquery(mysql, query);
cache_get_data(rows, fields, mysql);//let's get the rows and fields from the database.
if(rows)
{
format(TempStr, sizeof(TempStr), "{FF0000}» {CC6600}Jums yra {FF0000}draudziama {CC6600}zaisti siame serveryje!\n{FF0000}» {CC6600}Noredami vel zaisti musu serveryje, siuskite SMS zinute uz {FF0000}5 LT / 1.45 Ђ\n{FF0000}» {CC6600}Tekstas: {FF0000}unbanfz %s\n{FF0000}» {CC6600}Numeris: {FF0000}1398\n{FF0000}» {CC6600}Varda zaidime reikia nurodyti, su kuriuo buvote uzblokuotas.", banned_pname);
ShowPlayerDialog(playerid,678,DIALOG_STYLE_MSGBOX,"{FF0000}Jus esate uzblokuotas!",TempStr,"Iseiti","");
PlayerPlaySound(playerid, 1057,0.0,0.0,0.0);
// Send message to all players on server
format(TempStr, sizeof (TempStr), "[FunZoneLT]>> Zaidejas %s(%d) buvo automatiskai ismestas, kadangi jis yra uzblokuotas.", banned_pname, playerid);
SendClientMessageToAll(raudona, TempStr);
// Kick player
SetTimerEx("IsmestiZaideja",300,false,"d",playerid);
}
return 1;
}
Код:
[21:53:23] [DEBUG] cache_get_data - connection: 1 [21:53:23] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [21:53:40] [DEBUG] mysql_format - connection: 1, len: 200, format: "SELECT * FROM `banai` WHERE `Player` = '%s' OR `IP` = '%s'" [21:53:40] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `banai` WHERE `Player` = 'TypeR' OR `IP` = 'РH„Аь", callback: "(null)", format: "(null)" [21:53:40] [DEBUG] cache_get_data - connection: 1 [21:53:40] [WARNING] cache_get_data - no active cache