mysql_format(g_SQL, query, sizeof(query),"SELECT * FROM `bans` WHERE (`BanName` = '%e' OR `IP` = '%e') LIMIT 1",APlayerData[playerid][PlayerName],IP);
mysql_tquery(g_SQL, query, "BanCheck","is",playerid,IP);
forward BanCheck(playerid,IP[]);
public BanCheck(playerid,IP[])
{
new admin[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME],Reason[60], string[60],query[164],IP1[17];
if(cache_num_rows() >= 1)
{
for(new row; row < cache_num_rows(); row++)
{
cache_get_field_content(row, "AdminName", admin, g_SQL, sizeof(admin));
cache_get_field_content(row, "BanName", pname, g_SQL, sizeof(pname));
cache_get_field_content(row, "Reason", Reason, g_SQL, sizeof(Reason));
cache_get_field_content(row, "IP", IP1, g_SQL, sizeof(IP1));
}
SendClientMessage(playerid, C_RED,"Esti banat pe acest server!");
SendClientMessage(playerid, C_RED,"___________________");
format(string, sizeof(string),"Admin: %s", admin);
SendClientMessage(playerid, C_RED, string);
format(string, sizeof(string),"Nume: %s", pname);
SendClientMessage(playerid, C_RED, string);
format(string, sizeof(string),"Motiv: %s", Reason);
SendClientMessage(playerid, C_RED, string);
SendClientMessage(playerid, C_RED,"___________________");
SendClientMessage(playerid, C_RED, "Daca crezi ca ai primit ban pe nedrept fa o poza(F8) si posteaza-o pe forum la sectiuena serverului.");
SendClientMessage(playerid, C_RED, "www.gamelive.ro/forum");
if((strcmp(pName(playerid), pname, false, MAX_PLAYER_NAME) == 0) && (strcmp(IP1, IP, true, sizeof(IP1)) != 0))
{
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `bans` (`BanName`,`AdminName`,`IP`,`Reason`) VALUES ('%e','AdmBot','%e','Ban Evade')",pName(playerid),IP1);
mysql_tquery(g_SQL, query, "","");
}
else if((strcmp(pName(playerid), pname, false, MAX_PLAYER_NAME) != 0) && (strcmp(IP1, IP, true, sizeof(IP1)) == 0))
{
mysql_format(g_SQL, query, sizeof(query), "INSERT INTO `bans` (`BanName`,`AdminName`,`IP`,`Reason`) VALUES ('%e','AdmBot','%e','Ban Evade')",pName(playerid),IP1);
mysql_tquery(g_SQL, query, "","");
}
SetTimerEx("_KickPlayerDelayed", 500, false, "i", playerid);
}
return 1;
}
Give us some info:
OS MySQL Plugin version Server.cfg MySQL net_read_timeout MySQL max_allowed_packet MySQL innodb_buffer_pool_size Do you have blob data in your database? Are you using connect_timeout? somewhere You can collect them by using SHOW VARIABLES; query. |
gamemode0 Lejiune 1
plugins crashdetect.so mysql.so sscanf.so streamer.so
filterscripts mapeNick Mape clock
weburl
maxnpc 1
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
mapname Romana
language Romana
%e prints the number in scientific notation, e.g. 3.2165e+2.
"SELECT * FROM `bans` WHERE `IP` = '%s' LIMIT 1"
[00:48:51] [ERROR MYSQL]
[00:48:51] Error id: 2013
[00:48:51] Error message: Lost connection to MySQL server during query
[00:48:51] Query: SELECT * FROM `bans` WHERE (`BanName` = 'TheOne' OR `IP` = '188.24.208.101') LIMIT 1
[00:48:51] Callback: BanCheck
[00:48:51]
Hmm
1- Update your MySQL include to its last version and re-compile GM. DO THIS (https://github.com/pBlueG/SA-MP-MySQ...ases/tag/R39-6) 2- Try using mysql_static.so instead of mysql.so and see if error fixed. 3- Give us your bans table schema and length of that IP variable. 4- Are you sure its not server/host problems? like poor network connectivity or heavy network traffic |
Does the MySQL server run on the same machine as the SAMP server?
That would be recommended for fast access to your database. Connecting to a remote MySQL server is usually not done. It may work, but you'll get higher ping rates, slower data transfers and possible dropouts in connectivity. |