Command broken, don't know why.
#1

This is my code:

Код:
CMD:heal(playerid, params[])
{
	new Float:health, Float:tbhealedhealth, Float:healprice, Float:healtime, string[128];
	GetPlayerHealth(playerid, Float:health);
	tbhealedhealth = 100-health;
	healprice = tbhealedhealth*10;
	healtime = tbhealedhealth*100;
	
	format(string, sizeof(string), "health: %d | tbhealedhealth: %d | healprice: %d | healtime: %d", health, tbhealedhealth, healprice, healtime);
	SendClientMessage(playerid, -1, string);
	
	/*if(IsPlayerInRangeOfPoint(playerid, 5, HealPos1X, HealPos1Y, HealPos1Z))
	{
	    if(health < 100)
	    {
	        SendClientMessage(playerid, GREY, "test");
		}
	}*/
	return 1;
}
Obv it isn't going to output that message when I'm done scripting... But it was just put there to test to see if the values work. Thing is, they don't, and I have no idea why. Health becomes something like 12332435 or something crazy. Everything else is 0.

I have no idea why. Help?
Reply


Messages In This Thread
Command broken, don't know why. - by Trekkx - 28.08.2012, 23:16
Re: Command broken, don't know why. - by Jefff - 29.08.2012, 00:33
Re: Command broken, don't know why. - by Trekkx - 29.08.2012, 01:42

Forum Jump:


Users browsing this thread: 1 Guest(s)