15.03.2015, 16:34
I get this in my gamemode when i run server i get this in my server_log.
Here is code what is wrong with this ?
PHP Code:
[23:47:51] [debug] #0 0013c664 in public PingKick () from gm.amx
[00:39:24] [debug] Run time error 4: "Array index out of bounds"
[00:39:24] [debug] Accessing element at index 4 past array upper bound 3
[00:39:24] [debug] AMX backtrace:
Code:
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 is kicked. [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; } } } #if defined ANTI_MINIGUN new weap, ammo; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && PlayerInfo[i][Level] == 0) { GetPlayerWeaponData(i, 7, weap, ammo); if(ammo > 1 && weap == 38) { new string[128]; format(string,sizeof(string),"INFO: Player %s have minigun with %d ammo", PlayerName2(i), ammo); MessageToAdmins(COLOR_WHITE,string); } } } #endif }