Code:
new query[256];
GetPlayerIp(playerid, ip, sizeof(ip));
format(query, sizeof(query), "INSERT INTO `bans` (playername, ip, Reason, Date, BanBy) VALUES ('%s', '%s', 'Weapon Hacking', %d, 0)", GetName(playerid), ip, gettime());
mysql_tquery(dbHandle, query, "", "");
SavePlayerData(playerid);
ClearPlayerID(playerid);
SetTimerEx("KickPlayer", 100,false,"i",playerid);
Bans are spammed in mysql 5 or 6 times before the player is kicked, is there a way to avoid duplicate inserts?