givehp gethp?
#10

Quote:
Originally Posted by FaLLenGirL
View Post
PHP Code:
GiveHealthplayeridhealth 
change to:
PHP Code:
GiveHealthplayeridFloat:health 
and same as GetHealth.
It wont work heres the full code
Code:
stock DoctorShield()
{
	new Float:X,Float:Y,Float:Z,Float:hp,str[128];
	GetObjectPos(DocShield,X,Y,Z);
	foreach(Player,i)
	{
	    if(IsPlayerInRangeOfPoint(i,4.5,X,Y,Z))
		{
	        if(team[i] == TEAM_HUMAN)
			{
	            GetHealth(i,Float:hp);
	            if(hp < 80);
				{
                 GiveHealth(i,3.5);

	                format(str,sizeof(str),"~n~~n~~n~~n~~g~GETTING HEALED BY DOCTOR SHIELD~w~ (NEW HP: %.2f HP)",hp);
	                GameTextForPlayer(i,str,1000,5);
	            }
	            else
				{
	                GameTextForPlayer(i,"~n~~n~~n~~n~~r~YOU HAVE ENOUGH HP TO SURVIVE",1000,5);
	            }
	        }
	    }
	}
	return 1;
}
Here's the original code with setplayerhealth
Code:
stock DoctorShield()
{
	new Float:X,Float:Y,Float:Z,Float:hp,str[128];
	GetObjectPos(DocShield,X,Y,Z);
	foreach(Player,i)
	{
	    if(IsPlayerInRangeOfPoint(i,4.5,X,Y,Z))
		{
	        if(team[i] == TEAM_HUMAN)
			{
	            GetPlayerHealth(i,hp);
	            if(hp < 80)
				{
	                SetPlayerHealth(i,hp+3.5);
	                format(str,sizeof(str),"~n~~n~~n~~n~~g~GETTING HEALED BY DOCTOR SHIELD~w~ (NEW HP: %.2f HP)",hp);
	                GameTextForPlayer(i,str,1000,5);
	            }
	            else
				{
	                GameTextForPlayer(i,"~n~~n~~n~~n~~r~YOU HAVE ENOUGH HP TO SURVIVE",1000,5);
	            }
	        }
	    }
	}
	return 1;
}
Reply


Messages In This Thread
givehp gethp? - by Crystallize - 12.06.2017, 15:35
Re: givehp gethp? - by FaLLenGirL - 12.06.2017, 16:00
Re: givehp gethp? - by Crystallize - 12.06.2017, 16:01
Re: givehp gethp? - by FaLLenGirL - 12.06.2017, 16:08
Re: givehp gethp? - by Crystallize - 12.06.2017, 16:15
Re: givehp gethp? - by FaLLenGirL - 12.06.2017, 16:17
Re: givehp gethp? - by Crystallize - 12.06.2017, 16:18
Re: givehp gethp? - by Whatname - 12.06.2017, 16:20
Re: givehp gethp? - by FaLLenGirL - 12.06.2017, 16:26
Re: givehp gethp? - by Crystallize - 12.06.2017, 16:28

Forum Jump:


Users browsing this thread: 3 Guest(s)