need help in creating bonus hp textdraw
#1

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
Reply
#2

bumpy
Reply
#3

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

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;
}
Reply
#5

help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)