Raised This Month: $12 Target: $400
 3% 

Problem: Hns Shop+BM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kikifrh
Senior Member
Join Date: May 2009
Old 11-01-2009 , 13:41   Problem: Hns Shop+BM
Reply With Quote #1

I have a problem with hnshop and blockmaker:
If you buy 155hp, and go in a heal block, ur hp goes to 100. I need a way to the heal block stop healing at 100hp, but if ( ur hp> 100) won't heal.

Last edited by kikifrh; 11-02-2009 at 08:46.
kikifrh is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-01-2009 , 14:10   Re: Problem: HnShop+BM
Reply With Quote #2

HnShop? LOL. Hide N Shop?
__________________
hleV is offline
kikifrh
Senior Member
Join Date: May 2009
Old 11-01-2009 , 15:19   Re: Problem: HnShop+BM
Reply With Quote #3

Yeah. I say HnShop, 'cause it's faster to type... And like u saw, u understand it.
Waiting for the code...
kikifrh is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-01-2009 , 16:02   Re: Problem: HnShop+BM
Reply With Quote #4

dont heal
__________________
izzle is offline
kikifrh
Senior Member
Join Date: May 2009
Old 11-01-2009 , 17:55   Re: Problem: HnShop+BM
Reply With Quote #5

Yeah...
I need this:
If player's health is higher than 100, the heal block won't do anything (Now he is healing a person with more than 100hp to 100)[Ex:I bought 155HP, and go to a heal block, the heal block let me with 100hp]
But if the player's life is lower than 100, the heal block will heal the player, letting him with a maximum of 100hp[Ex: I fell from a high place and lose 10hp, the heal block will heal me (if I wait), until 100hp.
But: If I bought 155hp, and fell from a high place and lose 56hp, the heal block will heal me to 100hp
The question is, the heal block is "unhealing" persons who bought 155hp with Hns Shop. And I need to fix. Maybe with the actionHeal, if someone can script for me the new action, post here pls.
Thx for ur help
kikifrh is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-01-2009 , 18:15   Re: Problem: HnShop+BM
Reply With Quote #6

why would it heal you back to 155hp though you only bought 55hp...
__________________
izzle is offline
Old 11-01-2009, 18:19
kikifrh
This message has been deleted by kikifrh.
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-01-2009 , 18:28   Re: Problem: HnShop+BM
Reply With Quote #7

well try editing the blockmaker plugin in the section regarding to the healblock to check if ( hp is > 100 ) return PLUGIN_HANDLED
__________________


Trafalete is offline
izzle
Senior Member
Join Date: Aug 2009
Old 11-01-2009 , 18:33   Re: Problem: HnShop+BM
Reply With Quote #8

so you want it to take health away if they have more than 100hp?
__________________
izzle is offline
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-01-2009 , 18:37   Re: Problem: HnShop+BM
Reply With Quote #9

no...he wants for the block to do nothing if the user has over 100hp
__________________


Trafalete is offline
kikifrh
Senior Member
Join Date: May 2009
Old 11-01-2009 , 19:08   Re: Problem: HnShop+BM
Reply With Quote #10

Original actionHeal code:
Code:
actionHeal(id)
{
 if (halflife_time() >= gfNextHealTime[id])
 {
  new hp = get_user_health(id);
  new amount = floatround(get_cvar_float("bm_healamount"), floatround_floor);
  new sum = (hp + amount);
 
  if (sum < 100)
  {
   set_user_health(id, sum);
  }
  else
  {
   set_user_health(id, 100);
  }
 
  gfNextHealTime[id] = halflife_time() + 0.5;
 }
}
Will this work?
Code:
actionHeal(id)
{
if (halflife_time() >= gfNextHealTime[id])
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("bm_healamount"), floatround_floor);
new sum = (hp + amount);
 
if (sum < 100 > 150)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
 
gfNextHealTime[id] = halflife_time() + 0.5;
}
}
or
Code:
actionHeal(id)
{
 if (halflife_time() >= gfNextHealTime[id])
 {
  new hp = get_user_health(id);
  new amount = floatround(get_cvar_float("bm_healamount"), floatround_floor);
  new sum = (hp + amount);
 
  if (sum > 101)
  {
   set_user_health(id, sum);
  }
  else
  {
   set_user_health(id, 100);
  }
 
  gfNextHealTime[id] = halflife_time() + 0.5;
 }
}
some of the 2 may work?

Last edited by kikifrh; 11-01-2009 at 19:18. Reason: How are u?
kikifrh is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 05:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode