SetTimer("PingCheck", 1000 * 30, true);
SetTimer("PingCheck", 1000 * 30, true);
Originally Posted by Joe_
|
public PingCheck() { for(new i=0; i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(GetPVarInt(i,"IsSpawned") == 1) { if(GetPlayerPing(i) >= 1000) { new name[MAX_PLAYER_NAME],string[71]; GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s Has Been Kicked From The Server. (Reason: High Ping)"); SendClientMessageToAll(PINK,string); Kick(i); }}}} return 1; }
public PingCheck()
{
for(new i, string[71]; i != MAX_PLAYERS; i++)
if((GetPVarInt(i, "IsSpawned") == 1) && (GetPlayerPing(i) >= 1000))
{
GetPlayerName(i, string, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s Has Been Kicked From The Server. (Reason: High Ping)", string);
SendClientMessageToAll(PINK, string);
Kick(i);
}
}
Originally Posted by Kar
this doesn't send the person's name.. weird... it just leavwes a blank space and says Has Been kicked from the server etc..
|
new string[170];
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "%s has been kicked from the server (High Ping)",name);
SendClientMessageToAll(COLOR_COLOR,string);
public PingCheck()
{
for(new i=0; i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i,"IsSpawned") == 1)
{
if(GetPlayerPing(i) >= 1000)
{
new name[MAX_PLAYER_NAME],string[71];
GetPlayerName(i,name,sizeof(name)); // 1
format(string,sizeof(string),"%s Has Been Kicked From The Server. (Reason: High Ping)", name); // Remember ", name)) to get %s changed to the info that "name" is holding, and its the playername. I marked the line where "name" is getting the playername as information with 1.
SendClientMessageToAll(PINK,string);
Kick(i);
}}}}
return 1;
}