23.04.2015, 17:59
i found out is because of the bans. When someone gets banned and come back in server crashes.
PHP код:
stock CheckBanList(playerid)
{
new vas[32], unbandate, bool:ban, ip[32];
GetPlayerIp(playerid, ip, 32);
format(query, sizeof(query), "SELECT * FROM bans WHERE name = '%s'", sendername(playerid));
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row_format(query))
{
mysql_get_field("unbandate", var); unbandate = strval(var);
if(unbandate - gettime() > 0) ban = true;
}
else
{
format(query, sizeof(query), "DELETE FROM bans WHERE name = '%s'", sendername(playerid));
mysql_query(query);
}
format(query, sizeof(query), "SELECT * FROM bans WHERE ip = '%s'", ip);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row_format(query))
{
mysql_get_field("unbandate", var); unbandate = strval(var);
if(unbandate - gettime() > 0)
{
ban = true;
}
else
{
format(query, sizeof(query), "DELETE FROM bans WHERE ip = '%s'", ip);
mysql_query(query);
}
}
if(ban == true)
{
convert((unbandate-gettime())*1000,UBMin,UBSec,UBMSec);
UBHour = UBMin/60;
UBMin = UBMin%60;
UBDay = UBHour/24;
UBHour = UBHour%24;
new data[16], whobanned[32], reason[32];
mysql_get_field("bandate", data);
mysql_get_field("unbandate", vas); unbandate = strval(vas);
mysql_get_field("whobanned", whobanned);
mysql_get_field("reason", reason);
if(UBMin == 59)
{
UBHour++;
}
if(UBHour == 23)
{
UBDay++;
UBHour = 0;
}
format(string, 384,"Jusu konts: %s{FFFFFF}\n\
Statuss: {FF9900}Blokets{FFFFFF}\n\
Noblokets: %s\n\
Atblokets pec: %d dienam un %d stundam\n\
Blokeja: %s\n\
Blokeshanas iemesls: %s\n\
",sendername(playerid),data, UBDay,UBHour, whobanned, reason);
SPD(playerid, D_NULL, DIALOG_STYLE_MSGBOX, "Banned", string, "Aizvert", "");
Kick(playerid);
}
mysql_free_result();
}