MySQL spammed due to slow timer.
#2

Make a variable:

new bool:HasBeenKicked[MAX_PLAYERS] = false; //At the top of the script

HasBeenKicked[playerid] = false; //OnPlayerConnect

HasBeenKicked[playerid] = true; //Above the timer and below ClearPlayerID(playerid)


Then wrap it in:

pawn Код:
new bool:HasBeenKicked[MAX_PLAYERS] = false;

public OnPlayerConnect(playerid)
{
    HasBeenKicked[playerid] = false;
    return 1;
}

if(!HasBeenKicked[playerid]){
    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);
    HasBeenKicked[playerid] = true;
    SetTimerEx("KickPlayer", 100,false,"i",playerid);
}
Reply


Messages In This Thread
MySQL spammed due to slow timer. - by Dokins - 11.06.2016, 19:41
Re: MySQL spammed due to slow timer. - by iGetty - 11.06.2016, 21:51
Re: MySQL spammed due to slow timer. - by Dokins - 11.06.2016, 22:09
Re: MySQL spammed due to slow timer. - by iGetty - 11.06.2016, 22:34

Forum Jump:


Users browsing this thread: 1 Guest(s)