#1

Hola amigos de sa-mp mi problema es este en este public
Quote:

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, Average, x, string[128];
while (x < PING_MAX_EXCEEDS) {
Sum += PlayerInfo[i][pPing][x];
x++;
}
Average = (Sum / PING_MAX_EXCEEDS);
format(string,sizeof(string),"%s ha sido kickeado del server. (Razon: High Ping (%d) | Average (%d) | Max Allowed (%d) )", PlayerName2(i), GetPlayerPing(i), Average, ServerInfo[MaxPing] );
SendClientMessageToAll(grey,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 == 3 {
new string[128]; format(string,sizeof(string),"INFO: %s tiene el arma mingun con %d municiones", PlayerName2(i), ammo);
MessageToAdmins(COLOR_WHITE,string);
}
}
}
#endif
}

me manda esto el CrashDetect
Quote:

[19:30:01] [debug] Run time error 4: "Array index out of bounds"
[19:30:01] [debug] Accessing element at index 4 past array upper bound 3
[19:30:01] [debug] AMX backtrace:
[19:30:01] [debug] #0 000d7808 in public PingKick () from zde2.amx

espero q me puedan ayudar
Reply
#2

PHP код:
forward PingKick();
public 
PingKick()
{
    if(
ServerInfo[MaxPing] != 0)
    {
        
PingPos++; if(PingPos PING_MAX_EXCEEDSPingPos 0;
        
        for(new 
i=0i<MAX_PLAYERSi++)
        {
            
PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);
            
            if(
GetPlayerPing(i) > ServerInfo[MaxPing])
            {
                if(
PlayerInfo[i][PingCount] == 0PlayerInfo[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 
SumAveragexstring[128];
                    while (
PING_MAX_EXCEEDS) {
                        
Sum += PlayerInfo[i][pPing][x];
                        
x++;
                    }
                    
Average = (Sum PING_MAX_EXCEEDS);
                    
format(string,sizeof(string),"%s ha sido kickeado del server. (Razon: High Ping (%d) | Average (%d) | Max Allowed (%d) )"PlayerName2(i), GetPlayerPing(i), AverageServerInfo[MaxPing] );
                      
SendClientMessageToAll(grey,string);
                    
SaveToFile("KickLog",string);
                    
Kick(i);
                }
            }
            else if(
GetPlayerPing(i) < && ServerInfo[AntiBot] == 1)
            {
                
PlayerInfo[i][BotPing]++;
                if(
PlayerInfo[i][BotPing] >= 3BotCheck(i);
            }
            else
            {
                
PlayerInfo[i][BotPing] = 0;
            }
        }
    }

    
#if defined ANTI_MINIGUN
    
new weapammo;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][Level] == 0)
        {
            
GetPlayerWeaponData(i7weapammo);
            if(
ammo && weap == 38) {
                new 
string[128]; format(string,sizeof(string),"INFO: %s tiene el arma mingun con %d municiones"PlayerName2(i), ammo);
                
MessageToAdmins(COLOR_WHITE,string);
            }
        }
    }
    
#endif

Reply
#3

cual era el error pregunto : ! ?
Reply
#4

LoL ni se acuerda de el error que tenia lol te sirvio ??
Reply
#5

Cual era el error de por que me salia eso ¬¬
Reply
#6

asegun yo el tuyo tenia unas llaves de mas ^^
Reply
#7

: ! sigue dando el mismo problema xD
Reply
#8

Significa que estas usando un index mayor al declarado en el array.

Fijate las variables que creaste y que no estйs usando mбs de lo que creaste.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)