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

Solved Voodoo health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaimyneliS
BANNED
Join Date: Dec 2019
Location: https://t.me/pump_upp
Old 03-04-2020 , 17:17   Voodoo health
Reply With Quote #1

I need to not try to health a player whose hp is full or has under 100 hp damage

Code:
if(get_user_button(id) & IN_USE && can_heal[id])
			{
				new Distance
				for (new i = 1; i <= get_maxplayers(); i++)
				{
					if (is_user_alive(i) && us_get_user_zombie(i))
					{
						
						Distance = get_entity_distance(i, id)
						if (Distance <= RADIUS) 
						{
							new Float:Origin[3]
							pev(i, pev_origin, Origin)
						
							Origin[2] = Origin[2] + 20.0
						
							message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
							write_byte(TE_SPRITE)
							engfunc(EngFunc_WriteCoord, Origin[0])
							engfunc(EngFunc_WriteCoord, Origin[1])
							engfunc(EngFunc_WriteCoord, Origin[2])
							write_short(vodo_spirte) 
							write_byte(0) 
							write_byte(200)
							message_end() 
						
							new iHealth = get_user_health(i) + get_pcvar_num(cvar_voodoo_amount)
							if(iHealth <= get_zombie_maxhealth(i))
							{
								set_user_health(i, iHealth);
								
							}
							else set_user_health(i, get_zombie_maxhealth(i))
							
							set_last_use(id, get_gametime(), floatround(get_pcvar_float(cvar_voodoo_cooldown)), 1);
							set_task(1.0, "StopSpam", id+TASKID_HATE_SPAM);
						
							client_printcolor(id, "/y[/gUmbrella Swarm/y]  You have been Healed !!!")
							emit_sound(id, CHAN_STREAM,  voodoo_health, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
						}
					}
				}
			
				can_heal[id] = false
				set_task(get_pcvar_float(cvar_voodoo_cooldown), "reset_voodoo", id+TASK_COOLDOWN)
			}

Last edited by KaimyneliS; 03-07-2020 at 21:02.
KaimyneliS is offline
Send a message via ICQ to KaimyneliS Send a message via AIM to KaimyneliS Send a message via Yahoo to KaimyneliS
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-05-2020 , 13:39   Re: Voodoo health
Reply With Quote #2

So what's the problem exactly?
Why would you want to heal a player if his HP is full?
Are you sure you wrote the thread correctly?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 -4. The time now is 22:51.


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