GetPlayerHealth.
#1

Hey.

I am trying to finish off my freezetag game mode. But i am finding myself in a real pickle over the part that checks if the player should be frozen or not. The code is,

Код:
	new Float:health;
	health = GetPlayerHealth(playerid,health);
	if (health<100.0)
	{
	PlayerFreeze(playerid,30);
	}
Simple is it not?

And my PlayerFreeze script is

Код:
PlayerFreeze(playerid,seconds)
{
GFreeze[playerid]=true;
TogglePlayerControllable(playerid,0);
halt(seconds);
if (GFreeze[playerid])
{
SetPlayerHealth(playerid,0);
GFreeze[playerid]=false;
TogglePlayerControllable(playerid,1);
}
It is meant to check if the player is injured and if he is freeze him. Unfortunately for some reason when i first spawn it is just freezing me and killing me in thirty seconds. Now i know the only reason this happens is because the variable health is within 100.

My question is: What value does GetPlayerHealth(playerid,health) return, as i have read it is 1.0 and 100.0 could someone confirm which one it is or find the flaw in my coding which is causing this to happen?

Thanks much appreciated
Reply


Messages In This Thread
GetPlayerHealth. - by millzyman - 06.12.2009, 03:37
Re: GetPlayerHealth. - by Joe Staff - 06.12.2009, 05:11
Re: GetPlayerHealth. - by millzyman - 06.12.2009, 05:14
Re: GetPlayerHealth. - by Joe Staff - 06.12.2009, 05:17

Forum Jump:


Users browsing this thread: 3 Guest(s)