Server Warnings - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Server Warnings (
/showthread.php?tid=407568)
Server Warnings -
martin3644 - 14.01.2013
Hello!
I check what is this crashdetect plugin. When I'm using this, I got these errors:
pawn Код:
[16:25:33] [debug] Run time error 4: "Array index out of bounds"
[16:25:33] [debug] Accessing element at index 4 past array upper bound 3
[16:25:33] [debug] AMX backtrace:
[16:25:33] [debug] #0 0007614c in public PingKick () from LuxAdmin.amx
I have no idea what these errors mean and how to fix it. Are these errors a problem?
Sorry For Bad English
Re: Server Warnings -
martin3644 - 14.01.2013
Quote:
Originally Posted by ******
It means you have an array that's 4 elements big and you access element 5. The valid indices are 0, 1, 2, 3, so you are trying to access index 4 (which, like Milla Jovovich, is the fifth element).
|
Really hard to understand. How to fix this?
Thank You!
Re: Server Warnings -
martin3644 - 14.01.2013
NoOne Knows?
Re: Server Warnings -
u3ber - 14.01.2013
Quote:
Really hard to understand
|
what about it don't you understand?
Re : Server Warnings -
[HRD]Mar1 - 14.01.2013
pawn Код:
forward PingKick();
public PingKick()
{
if(ServerInfo[MaxPing] != 0)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
AccInfo[i][pPing] = 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),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
SendClientMessageToAll(grey,string);
Kick(i);
}
}
}
}
}
Re: Re : Server Warnings -
martin3644 - 15.01.2013
Quote:
Originally Posted by [HRD]Mar1
pawn Код:
forward PingKick(); public PingKick() { if(ServerInfo[MaxPing] != 0) {
for(new i=0; i<MAX_PLAYERS; i++) { AccInfo[i][pPing] = 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),"%s has been kicked from the server. (Reason: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] ); SendClientMessageToAll(grey,string); Kick(i); } } } } }
|
It works and never mind. I'm using now ladmin, not LuxAdmin. Too many bugs there.
Re: Server Warnings -
]Rafaellos[ - 15.01.2013
Im using LuxAdmin 1.5 and it works fine. No bugs in there.