Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.