SA-MP Forums Archive
need help in creating bonus hp textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: need help in creating bonus hp textdraw (/showthread.php?tid=567643)



need help in creating bonus hp textdraw - Nabster - 15.03.2015

I am trying to create a bonus health textdraw like a littlebar on healthbar which shows bonus HP,i tried to create but problem is i don't know how to update it when we take damage and remove it when bonushp reaches 0


Re: need help in creating bonus hp textdraw - Nabster - 16.03.2015

bumpy


Re: need help in creating bonus hp textdraw - CalvinC - 16.03.2015

Use OnPlayerTakeDamage to detect if the players bonushealth is 0, or to generally detect them loosing health.


Re: need help in creating bonus hp textdraw - Nabster - 16.03.2015

help pls?

Код:
CMD:test(playerid,params[])
{
	HPTimer = SetTimerEx("HBUpdate", 500, true, "i", playerid);
	GetPlayerHealth(playerid,health);
	BonusHP = SetPlayerHealth(playerid,health + 20);
	SendClientMessage(playerid,COLOR_GREEN,"ACTIVATED");
	return 1;
}
Код:
forward HBUpdate(playerid);
public HBUpdate(playerid)
{
	HealthBar[playerid] = CreatePlayerProgressBar(playerid, 589.000000, 69.000000, 20.000000, 2.000000, 1189758719, 20.000000, BAR_DIRECTION_RIGHT);
	SetPlayerProgressBarValue(playerid, HealthBar[playerid], BonusHP);
	ShowPlayerProgressBar(playerid,HealthBar[playerid]);
	if(BonusHP == 0)
	{
		KillTimer(HPTimer);
		DestroyPlayerProgressBar(playerid,HealthBar[playerid]);
	}
	return 1;
}



Re: need help in creating bonus hp textdraw - Nabster - 17.03.2015

help