11.06.2016, 21:51
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:
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);
}