You want it to show it?
Like this?
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin("ServerPing","1.0","Biscuit")
register_cvar("ServerPing","-999")
}
public TotalPing(){
new iPlayers[32], ServerPing, iNum, iTotalPing, iPing, iLoss
// get the players num and save their id into iPlayers array
get_players(iPlayers, iNum)
for(new i=0; i < iNum; i++)
{
// for each array cell that contain the id of a connected player, retrieve the player ping
get_user_ping(iPlayers[i], iPing, iLoss)
// add this ping ti the variable iTotalPing
iTotalPing += iPing
}
ServerPing = iTotalPing / iNum
set_cvar_num("ServerPing",ServerPing)
}
public Pingshow(){
new id = read_data(1)
new ServerPing
ServerPing = get_cvar_num ("ServerPing")
if(ServerPing <= 20){
client_print(id, print_chat, "ServerPing is good")
}else if (ServerPing >= 21 && ServerPing <= 50){
client_print(id, print_chat, "ServerPing is generally")
}else{
client_print(id, print_chat, "ServerPing is bad")
}
}
P.S acctualy i don't get it what you want...