Thread: Health bar
View Single Post
  #1  
Old 11-03-2011, 02:25 AM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Health bar

Well I´m trying to make a health bar in a gani. I was looking around the forums for help and my result was this:

PHP Code:
SCRIPT
function onPlayerEnters() {
  
hideimgs(2003000);
  
temp.pl findplayer(player.account);
  
with (findimg(200)) {
    
player.2/16;
    
player.1.75;
    
image "pirate_healthbar.png";
    
width maxWidth;
    
height maxHeight;
    
attachtoowner true;
  }
  
with (findimg(201+pl.id)) {
    
player.10/16;
    
player.1.75 3/16;
    
image "pirate_healthbar-progress.png";
    
width getimgwidth(image);
    
height getimgheight(image);
    
attachtoowner true;
  }
  
part=(pl.clientr.health_hearts/pl.clientr.health_fullhearts)*findimg(201+pl.id).width;
  
changeimgpart(201+pl.idfindimg(201+pl.id).width-part0partfindimg(201+pl.id).height); 
}
SCRIPTEND 
I know it´s not updating constantly but thats not my problem. My problem is that it shows the clients hp in the correct form. But the bar at the other players keeps saying that the player has 100% health even when it´s not true.

How can I fix it?
__________________
MEEP!
Reply With Quote