07.08.2010, 13:03
Coloque no OnGameModeInit:
Cуdigo do timer: (Embaixo das #include <...>
Exemplo, se quiser kickar quem tiver o ping maior que 700 faзa:
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.
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;
}
pawn Код:
Kick(g);
Por que "g"?
Este "g" й como se fosse playerid.