I don't know what is wrong but I know an way to make a simple healthbar script for players; an variable, window panel + frame panel and a digit panel if you want that too. When you an action/function effects the player health just change healthplayer variable in that action/function.

e.g. what I use in one of my maps:
Code:
BMAP* healthbarframe_bmp = "healthbarframe.bmp";
... 
var healthplayer = 150;
...

PANEL* first_pan =
{
	pos_x = 1077;
	pos_y = 919;
	layer = 1;
	bmap = healthbarframe_bmp;
	flags = OVERLAY | SHOW;
}

PANEL* second_pan =
{
    window (1080, 919, 65, 25, "healthbar.bmp", healthplayer, 0);
    flags = SHOW;
}

PANEL* third_pan =
{
	digits (1100, 900, 3, "Arial#15b", 0.667, healthplayer); 
	flags = SHOW | OUTLINE;



If players regenerate health, you can add this code within a while loop in the main function;

Code:
if (healthplayer < 150)
healthplayer += 0.03;



Hope that helps somewhat!


Last edited by reknak; 02/22/11 21:17. Reason: added BMAP*