12.09.2016, 06:01
error
Code
Код:
[01:51:37] [debug] Run time error 4: "Array index out of bounds" [01:51:37] [debug] Accessing element at index 4 past array upper bound 3 [01:51:37] [debug] AMX backtrace: [01:51:37] [debug] #0 00118d74 in public PingKick () from codww.amx [01:52:03] [connection] 117.243.182.73:26861 requests connection cookie. [01:52:05] [connection] incoming connection: 117.243.182.73:26861 id: 0 [01:52:09] Invalid client connecting from 117.243.182.73 [01:52:30] [debug] Run time error 4: "Array index out of bounds" [01:52:30] [debug] Accessing element at index 4 past array upper bound 3 [01:52:30] [debug] AMX backtrace: [01:52:30] [debug] #0 00118d74 in public PingKick () from codww.amx [01:52:35] Kicking 117.243.182.73 because they didn't logon to the game.
Код:
forward PingKick(); public PingKick() { if(ServerInfo[MaxPing] != 0) { PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0; for(new i=0; i<MAX_PLAYERS; i++) { PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i); if(GetPlayerPing(i) > ServerInfo[MaxPing]) { if(PlayerInfo[i][PingCount] == 0) PlayerInfo[i][PingTime] = TimeStamp(); PlayerInfo[i][PingCount]++; if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT) { PlayerInfo[i][PingTime] = TimeStamp(); PlayerInfo[i][PingCount] = 1; } else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS) { new Sum, x, string[128]; while (x < PING_MAX_EXCEEDS) { Sum += PlayerInfo[i][pPing][x]; x++; } format(string,sizeof(string),"%s has been kicked from the server. [Reason: High Ping %d/%d]", PlayerName2(i), GetPlayerPing(i), ServerInfo[MaxPing] ); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); Kick(i); } } else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1) { PlayerInfo[i][BotPing]++; if(PlayerInfo[i][BotPing] >= 3) BotCheck(i); } else { PlayerInfo[i][BotPing] = 0; } } }