Код:
public PingKick()
{
if(ServerInfo[MaxPing] != 0)
{
PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
AccInfo[i][pPing][PingPos] = GetPlayerPing(i);
if(GetPlayerPing(i) > ServerInfo[MaxPing])
{
if(AccInfo[i][PingCount] == 0) AccInfo[i][PingTime] = TimeStamp();
AccInfo[i][PingCount]++;
if(TimeStamp() - AccInfo[i][PingTime] > PING_TIMELIMIT)
{
AccInfo[i][PingTime] = TimeStamp();
AccInfo[i][PingCount] = 1;
}
else if(AccInfo[i][PingCount] >= PING_MAX_EXCEEDS)
{
new Sum, Average, x, string[128];
while (x < PING_MAX_EXCEEDS) {
Sum += AccInfo[i][pPing][x];
x++;
}
Average = (Sum / PING_MAX_EXCEEDS);
format(string,sizeof(string),"|- Player %s (Id:%d) has been Automatically Kicked. | Reason: High Ping - %d (Average - %d | Max Allowed - %d)", PlayerName2(i),i, GetPlayerPing(i), Average, ServerInfo[MaxPing]);
SendClientMessageToAll(grey,string);
SaveIn("KickLog",string);
Kick(i);
}
}
else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
{
AccInfo[i][BotPing]++;
if(AccInfo[i][BotPing] >= 3) BotCheck(i);
}
else
{
AccInfo[i][BotPing] = 0;
}
}
}
}
Код:
[18:30:45] [debug] #0 0007dc04 in PingKick () from LuxAdmin.amx
[18:30:45] [debug] Backtrace (most recent call first):
[18:30:45] [debug] Accessing element at index 4 past array upper bound 3
[18:30:45] [debug] Run time error 4: "Array index out of bounds"
[18:30:18] [debug] #0 0007dc04 in PingKick () from LuxAdmin.amx
[18:30:18] [debug] Backtrace (most recent call first):
[18:30:18] [debug] Accessing element at index 4 past array upper bound 3
[18:30:18] [debug] Run time error 4: "Array index out of bounds"
[18:29:51] [debug] #0 0007dc04 in PingKick () from LuxAdmin.amx
[18:29:51] [debug] Backtrace (most recent call first):
[1