ok so heres a plugin that shows the players HP in a hud msg in the upper left corner... the HP hud msg seems to work fine (well except the cvar part is messed up i guess, becuase setting it to 0 makes no difference lol)
my problem is.. that rarely (and i mean like 1 time in 15minutes or so) does any of the stats hud msgs show.. like bullet dmg, end round stats, killer/victim info, etc...
im guessing it has to be cuase of the way im doing the hud msg in this plugin becuase I just added to my server tonight and thats when it started happening...
I also tried it before & after the stats plugin in the plugin.ini but that made no difference...
so heres the code:
Code:
#include <amxmodx>
#define MAXPLAYERS 17
new p_amx_showhealth, g_health_sync
public plugin_init()
{
register_plugin("Show Health","1.0","diamond-optic")
p_amx_showhealth = register_cvar("amx_showhealth", "1")
g_health_sync = CreateHudSyncObj()
}
public client_putinserver(id) {
if ((!get_pcvar_num(p_amx_showhealth)) || (!is_user_connected(id)) || (is_user_bot(id))) //dont bother if not using
return PLUGIN_HANDLED
set_task(1.0,"show_health",1,"",0,"b") //set the task
return PLUGIN_CONTINUE
}
public show_health()
{
set_hudmessage(255, 255, 255, 0.01, 0.08, 0, 0.0, 2.0, 0.0, 0.0)
for(new i=1;i <= MAXPLAYERS;i++)
if((is_user_alive(i)) && (is_user_connected(i)))
{
ShowSyncHudMsg(i,g_health_sync,"%d HP",get_user_health(i))
}
}
any help would be AWESOME lol
__________________