OnPlayerTakeDamage not working correctly?
#1

Hello all. Today i have created an HUD bar that replaces default gta health bar.
So, here's the problem;

The HUD works correctly, but losing damage, the HUD bar doesn't change.
Here's my script;
Код:
stock UpdateHealth(playerid)
{
new Float:vita;
new Float:armour;
GetPlayerHealth(playerid,vita);
GetPlayerArmour(playerid,armour);
TextDrawHideForPlayer(playerid,HudHealth[playerid]);
TextDrawHideForPlayer(playerid,HudArmour[playerid]);
if(vita <= 5.0)
{
TextDrawSetString(HudHealth[playerid],"~l~IIIIIIIIII");
}
if(vita >= 6.0 && vita <= 9.0)
{
TextDrawSetString(HudHealth[playerid],"I~l~IIIIIIIII");
}
if(vita >= 11.0 && vita <= 20.0)
{
TextDrawSetString(HudHealth[playerid],"II~l~IIIIIIII");
}
if(vita >= 21.0 && vita <= 30.0)
{
TextDrawSetString(HudHealth[playerid],"III~l~IIIIIII");
}
if(vita >= 31.0 && vita <= 40.0)
{
TextDrawSetString(HudHealth[playerid],"IIII~l~IIIIII");
}
if(vita >= 41.0 && vita <= 50.0)
{
TextDrawSetString(HudHealth[playerid],"IIIII~l~IIIII");
}
if(vita >= 51.0 && vita <= 60.0)
{
TextDrawSetString(HudHealth[playerid],"IIIIII~l~IIII");
}
if(vita >= 61.0 && vita <= 70.0)
{
TextDrawSetString(HudHealth[playerid],"IIIIIII~l~III");
}
if(vita >= 71.0 && vita <= 80.0)
{
TextDrawSetString(HudHealth[playerid],"IIIIIIII~l~II");
}
if(vita >= 81.0 && vita <= 90.0)
{
TextDrawSetString(HudHealth[playerid],"IIIIIIIII~l~I");
}
if(vita >= 90.0)
{
TextDrawSetString(HudHealth[playerid],"IIIIIIIIII~l~");
}

if(armour <= 0.0)
{
TextDrawSetString(HudArmour[playerid],"~l~IIIIIIIIII");
}
if(armour >= 6.0 && armour <= 9.0)
{
TextDrawSetString(HudArmour[playerid],"I~l~IIIIIIIII");
}
if(armour >= 11.0 && armour <= 20.0)
{
TextDrawSetString(HudArmour[playerid],"II~l~IIIIIIII");
}
if(armour >= 21.0 && armour <= 30.0)
{
TextDrawSetString(HudArmour[playerid],"III~l~IIIIIII");
}
if(armour >= 31.0 && armour <= 40.0)
{
TextDrawSetString(HudArmour[playerid],"IIII~l~IIIIII");
}
if(armour >= 41.0 && armour <= 50.0)
{
TextDrawSetString(HudArmour[playerid],"IIIII~l~IIIII");
}
if(armour >= 51.0 && armour <= 60.0)
{
TextDrawSetString(HudArmour[playerid],"IIIIII~l~IIII");
}
if(armour >= 61.0 && armour <= 70.0)
{
TextDrawSetString(HudArmour[playerid],"IIIIIII~l~III");
}
if(armour >= 71.0 && armour <= 80.0)
{
TextDrawSetString(HudArmour[playerid],"IIIIIIII~l~II");
}
if(armour >= 81.0 && armour <= 90.0)
{
TextDrawSetString(HudArmour[playerid],"IIIIIIIII~l~I");
}
if(armour >= 90.0)
{
TextDrawSetString(HudArmour[playerid],"IIIIIIIIII~l~");
}
TextDrawShowForPlayer(playerid,HudArmour[playerid]);
TextDrawShowForPlayer(playerid,HudHealth[playerid]);
}
And,
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
	UpdateHealth(playerid);
	return 1;
}
Please help me, a friend talked about an include that fixes it but i didn't find anything!

ps; Sorry for bad eng.
Reply
#2

UP.........
Reply
#3

Onestly, why no-one can help me?
Reply
#4

up........................
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)