Better to use get_players.
PHP Code:
#include <amxmodx>
public plugin_init()
{
set_task(1.0, "show_health", .flags="b")
}
public show_health()
{
new iPlayers[32], iNum, iHealth
get_players(iPlayers, iNum, "ae", "CT")
for(new i; i<iNum; i++)
{
iHealth += get_user_health(iPlayers[i])
}
set_hudmessage(0, 0, 255, -1.0, 0.1, 0, 0.000001, 1.0, 0.501, 0.501, -1)
show_hudmessage(0, "CT Total Health: %d", iHealth)
}
__________________