GetPlayerNetworkStats() crash the server
#3

It's most likely your code, try this:

pawn Код:
forward Timer1();
public Timer1() //every second timer
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new
                dest[512],
                pos[2],
                bytes;

            GetPlayerNetworkStats(i,dest,sizeof(dest));

            if ((pos[0] = strfind(dest, "Bytes received", true) + 16) > 15)
            {
                if ((pos[1] = strfind(dest, "Acks rece", true)) == -1)
                    continue;
           
                dest[pos[1]] = '\0';
                bytes = strval(dest[pos[0]]);

                if (bytes > (LastBytes[i] + 20000))
                {
                    WarningBytes[i] ++;

                    if (WarningBytes[i] > 3)
                    {
                        printf("[Attack 2] Player %d",i);
                        Kick(i);
                        continue;
                    }
                }
                LastBytes[i] = bytes;
            }
        }
    }
}
Reply


Messages In This Thread
GetPlayerNetworkStats() crash the server - by RingoRus - 22.01.2014, 16:45
Re: GetPlayerNetworkStats() crash the server - by Cypen - 24.01.2014, 15:06
Re: GetPlayerNetworkStats() crash the server - by Emmet_ - 24.01.2014, 15:14

Forum Jump:


Users browsing this thread: 2 Guest(s)