Thread: Health bar
View Single Post
  #7  
Old 11-03-2011, 04:57 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
Well I´m adding the gani to the players attributes whenever the player is hit (also changes the health than). And I made something like this in the gani
PHP Code:
SCRIPT
function onPlayerEnters() {
  
hideimgs(200201);
  
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)) {
    
player.10/16;
    
player.1.75 3/16;
    
image "pirate_healthbar-progress.png";
    
width getimgwidth(image);
    
height getimgheight(image);
    
attachtoowner true;
  }
  
part=(pl.attr[28]/pl.attr[29])*findimg(201).width;
  
changeimgpart(201findimg(201).width-part0partfindimg(201).height); 
  
settimer(3);
}

function 
onTimeOut() {
  for (
temp.1temp.=> 0temp.-= 0.01) {
    
changeimgcolors(200iiii);
    
changeimgcolors(201iiii);
    
sleep(0.05);
  }
  if (
findimg(200).alpha == || findimg(201).alpha == 0player.attr[2] = "";
}
SCRIPTEND 
__________________
MEEP!
Reply With Quote