All pastes #676313 Raw Edit

Anonymous

public text v1 · immutable
#676313 ·published 2007-08-30 22:54 UTC
rendered paste body
forward PingCheck();
public PingCheck()
{
	
	for (new i = 0; i < MAX_PLAYERS; i++)
 	{
 	    //1 = AVG total
 	    //2 = Current
 	    pPLAYER[ i ][ 2 ] = GetPlayerPing(i);
 	    pPLAYER[ i ][ 1 ] = pPLAYER[ i ][ 1 ] + pPLAYER[ i ][ 2 ];
 	    
  	}
	if (TimerRND == 8)
	{
		for (new q = 0; q < MAX_PLAYERS; q++)
		{
  				pPLAYER[ q ][ 3 ] = floatdiv( float( pPLAYER[ q ][ 1 ] ), 8.0 );
		        if (pPLAYER[ q ][ 3 ] > 550)
		        {
		            if (IsPlayerConnected(q))
		            {
                        if ( GetPlayerState( q ) != PLAYER_STATE_NONE )
                        {
		            		LW_Kick( q, 1000, "High Ping");
						}
					}
				}
				pPLAYER[ q ][ 1 ] = 0;
		}
		TimerRND = 0;
	}
	TimerRND++;
}