Raised This Month: $ Target: $400
 0% 

blockmaker healer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadezz
Senior Member
Join Date: Jul 2009
Location: Denmark
Old 01-01-2011 , 10:09   blockmaker healer
Reply With Quote #1

Hey, i just found out that on my SCM the healer wont heal to more than 100, and if ppl got 125 hp with CashMod for an example, healer will just heal to 100, so ive tried if i can make it heal to the right hp (125)

for that ive tried with this:

PHP Code:
ActionHeal(ident)
{
 new 
Float:gametime get_gametime();
 if ( !( 
gametime >= g_next_heal_time[id] ) ) return PLUGIN_HANDLED;
 
 
 new 
health get_user_health(id);
 if ( 
health playerHealth[id] );
 {
  static 
property[5];
 
  
GetProperty(ent1property);
  
health += str_to_num(property);
  
set_user_health(idmin(playerHealth[id], health));
  
  
GetProperty(ent2property);
  
g_next_heal_time[id] = gametime str_to_float(property);
 }
 
 return 
PLUGIN_HANDLED;

and then i get the errors:
Quote:
/home/groups/amxmodx/tmp3/phpNn3M6Y.sma(146 : error 017: undefined symbol "playerHealth"
/home/groups/amxmodx/tmp3/phpNn3M6Y.sma(146 : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpNn3M6Y.sma(146 : error 001: expected token: ";", but found "]"
/home/groups/amxmodx/tmp3/phpNn3M6Y.sma(146 : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpNn3M6Y.sma(146 : fatal error 107: too many error messages on one line
could some1 help me? :S
__________________
Shadezz is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 01-01-2011 , 11:59   Re: blockmaker healer
Reply With Quote #2

Which are the problem lines and what is
Code:
playerHealth[id] 


SpeeDeeR is offline
Shadezz
Senior Member
Join Date: Jul 2009
Location: Denmark
Old 01-01-2011 , 12:43   Re: blockmaker healer
Reply With Quote #3

i have a plugin named CashMod where u can buy a "upgrade" so u get more hp, for an example 125, then, i have my blockmaker(ShaDezz Course Maker) where there is a regenerate block(Healer block) which im trying to do so it can heal to 125 instead of just healing to 100, im trying to make it heal to 125 IF u have cashmod upgrade
__________________
Shadezz is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 01-01-2011 , 13:10   Re: blockmaker healer
Reply With Quote #4

Quote:
Originally Posted by Shadezz View Post
i have a plugin named CashMod where u can buy a "upgrade" so u get more hp, for an example 125, then, i have my blockmaker(ShaDezz Course Maker) where there is a regenerate block(Healer block) which im trying to do so it can heal to 125 instead of just healing to 100, im trying to make it heal to 125 IF u have cashmod upgrade
If you want to do that, you'll have to add a native to cashmods include that returns the players health, and use it in the blockmaker.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Shadezz
Senior Member
Join Date: Jul 2009
Location: Denmark
Old 01-01-2011 , 18:52   Re: blockmaker healer
Reply With Quote #5

yeah but i dno how to do that
__________________
Shadezz is offline
trooligt
New Member
Join Date: Dec 2010
Location: sweden
Old 01-12-2011 , 14:15   Re: blockmaker healer
Reply With Quote #6

shadezz heres the code for heal block to heal over 100

Code:
ActionHeal(id, ent)
{
	new Float:gametime = get_gametime();
	if ( !( gametime >= g_next_heal_time[id] ) ) return PLUGIN_HANDLED;
	
	new health = get_user_health(id);
	if ( health >= 250 ) return PLUGIN_HANDLED;
	
	static property[5];
	
	GetProperty(ent, 1, property);
	health += str_to_num(property);
	set_user_health(id, min(250, health));
	
	GetProperty(ent, 2, property);
	g_next_heal_time[id] = gametime + str_to_float(property);
	
	return PLUGIN_HANDLED;
trooligt is offline
Send a message via Skype™ to trooligt
Shadezz
Senior Member
Join Date: Jul 2009
Location: Denmark
Old 01-12-2011 , 15:39   Re: blockmaker healer
Reply With Quote #7

Trooligt.. that will heal u instant to 250.. this was what needed
Quote:
ActionHeal(id, ent)
{
new Float:gametime = get_gametime();
if( !(gametime >= g_next_heal_time[id]) )
{
return PLUGIN_HANDLED;
}

static property[5];
GetProperty(ent, 1, property);

new Float:new_health = get_user_health(id) + str_to_float(property);
new CashHealth = (100 + (25 * cm_get_health_level(id)));

if( new_health < CashHealth )
{
entity_set_float(id, EV_FL_health, new_health);
}
else
{
entity_set_float(id, EV_FL_health, float(CashHealth));
}

static Float:interval;
GetProperty(ent, 2, property);
interval = str_to_float(property);
g_next_heal_time[id] = gametime + interval;

return PLUGIN_HANDLED;
}
fixed by nnajko
__________________
Shadezz 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 02:00.


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