Simple, but not efficient method:
PHP Code:
#include <amxmodx>
#include <cstrike>
new g_max_players
public plugin_init(){
set_task(1.0, "show_health", 325236, _, _, "b")
g_max_players = get_maxplayers()
}
public show_health(){
new total_health
for(new i=1; i<=g_max_players; i++){
if(is_user_alive(i) && cs_get_user_team(i)==CS_TEAM_CT)
total_health += get_user_health(i)
}
set_hudmessage(0, 0, 255, -1.0, 0.1, 0, 6.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(0, "CT Total Health: %d", total_health)
}
To make it more efficient you should cache alive cts, health and update it when player is damaged.
__________________