public PING(playerid)
{
if((GetPlayerPing(playerid) >= 600 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING estб maior ou igual а 600.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 800 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING continua subindo ! Tente ajeitar sua conexгo.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 1000 && GetPlayerPing(playerid) != 65535))
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof (playername))
SendClientMessage(playerid,COLOR_RED," Vocк foi kickado pelo servidor, pois seu PING atingiu 1000."); //LINHA 5282
SendClientMessage(playerid,COLOR_RED," Isto й uma forma de evitar que o servidor fique com LAG.");
SendClientMessageToAll(TEAM_ADMIN_COLOR, "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);//LINHA 5284
Kick(playerid);
}
return 1;
}
(5282) : error 001: expected token: ";", but found "-identifier-"
(5284) : warning 202: number of arguments does not match definition
public PING(playerid)
{
if((GetPlayerPing(playerid) >= 600 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING estб maior ou igual а 600.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 800 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING continua subindo ! Tente ajeitar sua conexгo.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 1000 && GetPlayerPing(playerid) != 65535))
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);//Faltou uma parte da sintaxe do cуdigo, o semicolon.
SendClientMessage(playerid,COLOR_RED," Vocк foi kickado pelo servidor, pois seu PING atingiu 1000."); //LINHA 5282
SendClientMessage(playerid,COLOR_RED," Isto й uma forma de evitar que o servidor fique com LAG.");
SendClientMessageToAll(TEAM_ADMIN_COLOR, "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);//LINHA 5284
Kick(playerid);
}
return 1;
}
SendClientMessageToAll(TEAM_ADMIN_COLOR, "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);
Pronto a linha 5282 (a que vocк corrigiu) agora nao deu erro
Mas a 5284 ta dando o mesmo erro: (5284) : warning 202: number of arguments does not match definition pawn Код:
|
new string[ 128 ]; format(string, sizeof( string ), "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername); SendClientMessageToAll(TEAM_ADMIN_COLOR, string);
new string[128];
funfou =D vlw ... mas pra q serve esse ngc de:
pawn Код:
|
pawn Код:
|
Mas tem um problema ...
Eu to testando aqui sozinho na minha net Entao eu mudei o valor pra 1, logo se o ping foi >= 1 deveria aparecer esse aviso mas num ta mostrando :/ |
public OnGameModeInit()
{
SetTimer("PING",1000,false); // 1000ms = 1s , entгo irб fazer a checagem a cada 1s para ver se o ping estб acima do permitido.
return 1;
}
public PING(playerid)
{
if(IsPlayerConnected(playerid))
{
if((GetPlayerPing(playerid) >= 600 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING estб maior ou igual а 600.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 800 && GetPlayerPing(playerid) != 65535))
{
SendClientMessage(playerid,COLOR_RED," Seu PING continua subindo ! Tente ajeitar sua conexгo.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if((GetPlayerPing(playerid) >= 1000 && GetPlayerPing(playerid) != 65535))
{
new playername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, playername, sizeof (playername));
SendClientMessage(playerid,COLOR_RED," Vocк foi kickado pelo servidor, pois seu PING atingiu 1000.");
SendClientMessage(playerid,COLOR_RED," Isto й uma forma de evitar que o servidor fique com LAG.");
format(string, sizeof(string), "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);
SendClientMessageToAll(TEAM_ADMIN_COLOR, string);
Kick(playerid);
}
return 1;
}
}
forward PING(playerid);
(5295) : warning 209: function "PING" should return a value
public PING(playerid)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerPing(playerid) >= 600 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 5000, true);
SendClientMessage(playerid,COLOR_RED," Seu PING estб maior ou igual а 600.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if(GetPlayerPing(playerid) >= 800 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 1000, true);
SendClientMessage(playerid,COLOR_RED," Seu PING continua subindo ! Tente ajeitar sua conexгo.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if(GetPlayerPing(playerid) >= 1000 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 1000, true);
new playername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, playername, sizeof (playername));
SendClientMessage(playerid,COLOR_RED," Vocк foi kickado pelo servidor, pois seu PING atingiu 1000.");
SendClientMessage(playerid,COLOR_RED," Isto й uma forma de evitar que o servidor fique com LAG.");
format(string, sizeof(string), "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);
SendClientMessageToAll(TEAM_ADMIN_COLOR, string);
Kick(playerid);
KickLog(string);
}
return 1;
}
} //LINHA 5295
public PING(playerid)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerPing(playerid) >= 600 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 5000, true);
SendClientMessage(playerid,COLOR_RED," Seu PING estб maior ou igual а 600.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if(GetPlayerPing(playerid) >= 800 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 1000, true);
SendClientMessage(playerid,COLOR_RED," Seu PING continua subindo ! Tente ajeitar sua conexгo.");
SendClientMessage(playerid,COLOR_RED," Caso ele atinga 1000 vocк serб kickado automaticamente pelo servidor.");
}
if(GetPlayerPing(playerid) >= 1000 && GetPlayerPing(playerid) != 65535)
{
SetTimer("PING", 1000, true);
new playername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, playername, sizeof (playername));
SendClientMessage(playerid,COLOR_RED," Vocк foi kickado pelo servidor, pois seu PING atingiu 1000.");
SendClientMessage(playerid,COLOR_RED," Isto й uma forma de evitar que o servidor fique com LAG.");
format(string, sizeof(string), "%s foi kickado pelo servidor, pois seu PING atingiu 1000.", playername);
SendClientMessageToAll(TEAM_ADMIN_COLOR, string);
Kick(playerid);
KickLog(string);
}
}
return 1;
}
KickLog(string);
}
return 1;
}
}
KickLog(string);
}
}
return 1;
}