diff --git a/jenz_ban_detector/scripting/jenz_ban_detector.sp b/jenz_ban_detector/scripting/jenz_ban_detector.sp index 8c253f6f..7b589107 100644 --- a/jenz_ban_detector/scripting/jenz_ban_detector.sp +++ b/jenz_ban_detector/scripting/jenz_ban_detector.sp @@ -140,8 +140,10 @@ public void SQL_checkSourcebans(Database db, DBResultSet results, const char[] e results.FetchString(0, sSID, sizeof(sSID)); results.FetchString(1, sIP, sizeof(sIP)); char sql_statement[512]; + //PrintToChatAll(sSID); + //PrintToChatAll(sIP); // + 3600 for one hour to accomdate timezone difference - Format(sql_statement, sizeof(sql_statement), "select authid, ip from sb_bans where (ip = '%s' or authid = '%s') and (RemoveType != 'U' or RemoveType is NULL) and (ends > UNIX_TIMESTAMP() + 3600 or ends = created) order by created desc limit 1", sIP, sSID); + Format(sql_statement, sizeof(sql_statement), "select authid, ip from sb_bans where ((ip = '%s' and ip is not null and ip != '') or (authid = '%s' and authid is not null and authid =! '')) and (RemoveType != 'U' or RemoveType is NULL) and (ends > UNIX_TIMESTAMP() + 3600 or ends = created) order by created desc limit 1", sIP, sSID); g_hDatabase_sourceban.Query(sql_select_sb_bans, sql_statement, client, DBPrio_High); } delete results;