Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 08-11-2011, 08:32 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Thank you! That updated commands.rtf helped a lot
Reply With Quote
  #17  
Old 08-11-2011, 08:43 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
function onPlayerHurt definitely invokes on the clientside if you were still having issues with it.

However, you will need to rescript how healing works on your server (namely detecting if a player is in a bed and changing the heart drop items? rescript pots?) so that it would throw an event or trigger the health display to update as well if you don't want to use a timeout
Reply With Quote
  #18  
Old 08-11-2011, 08:54 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Hm...it works part time.

The player.chat works, but the GUI doesn't update.

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  new 
GuiControlProfile(ATextProfile
  {
    
fontcolor "0 0 0";
    
fonttype "Arial";
    
fontsize 25;
    
fontstyle "b";
  }
    
  new 
GuiProgressCtrl("HealthControl_Bar"
  {
    
profile GuiBlueProgressProfile;
    
width 360;
    
height 40;
    
screenwidth width 20;
    
10;
    
progress player.hearts/player.fullhearts;
    
    new 
GuiTextCtrl("HealthConrol_Text"
    {
      
profile ATextProfile;
      
HealthControl_Bar.width this.width 2;
      
10;
      
height 20;
      
width 80;
      
text player.hearts SPC "/" SPC player.fullhearts;
    } 
  }
}

function 
onPlayerHurt()
{
  
player.chat "HURT";
  
HealthControl_Bar player.hearts/player.fullhearts;
  
HealthControl_Text.text player.hearts SPC "/" SPC player.fullhearts;

Reply With Quote
  #19  
Old 08-11-2011, 09:21 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I would recommend checking the names in your GUI.

Particularly: new GuiTextCtrl("HealthConrol_Text")
__________________
Quote:
Reply With Quote
  #20  
Old 08-12-2011, 12:49 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
You seem to have missed something.

Change

PHP Code:
HealthControl_Bar player.hearts/player.fullhearts
into

PHP Code:
HealthControl_Bar.progress player.hearts/player.fullhearts
in your onPlayerHurt() function.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #21  
Old 08-12-2011, 08:40 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by xXziroXx View Post
You seem to have missed something.

Change

PHP Code:
HealthControl_Bar player.hearts/player.fullhearts
into

PHP Code:
HealthControl_Bar.progress player.hearts/player.fullhearts
in your onPlayerHurt() function.
yep
Reply With Quote
  #22  
Old 08-12-2011, 09:01 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Oh my, isn't that clumsy!

Should've double checked those things before I posted. Really sorry for taking up your time with spelling errors :S

Thank you though, it works now
Reply With Quote
Reply


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 07:47 AM.


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