[Ajuda] Ping
#2

Coloque no OnGameModeInit:

pawn Код:
SetTimer("TimerPing",2000,true);


Cуdigo do timer: (Embaixo das #include <...>

pawn Код:
forward TimerPing();
public TimerPing()
{
     for(new g=0;g<=MAX_PLAYERS;g++) {
          if(IsPlayerConnected(g)) {
               new ping=GetPlayerPing(g);
               if(ping>=100&&ping<400) {
                    //faz oq estб aki (maior q 100, menor que 400)
               }
               if(ping>=400&&ping<700) {
                    //faz oq estб aki (maior q 400, menor que 700)
               }
               if(ping>=700) {
                    //faz oq estб aki (maior q 700)
               }
          }
     }
     return 1;
}
Exemplo, se quiser kickar quem tiver o ping maior que 700 faзa:

pawn Код:
Kick(g);
Isso dentro das 'chaves' de onde estб escrito: "//faz oq estб aki (maior q 700)", sem as //
Por que "g"?
Este "g" й como se fosse playerid.
Reply


Messages In This Thread
[Ajuda] Ping - by junioor - 07.08.2010, 12:52
Re: [Ajuda] Ping - by SuB_ZeRo0_ - 07.08.2010, 13:03
Re: [Ajuda] Ping - by junioor - 07.08.2010, 13:50
Re: [Ajuda] Ping - by Kasura - 07.08.2010, 14:13
Re: [Ajuda] Ping - by junioor - 07.08.2010, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)