12.02.2011, 13:17
hi,
as soon as a player got less than 20% of life i want that a textdraw shows upand hides again so i get a kind of flash effect.
Well, for me it works but if there are are more players on the server its buggy.
The textdraw also shows up for other players but i dont know why cause i used settimerex and textdrawforplayer.
Some help would be great
as soon as a player got less than 20% of life i want that a textdraw shows upand hides again so i get a kind of flash effect.
Well, for me it works but if there are are more players on the server its buggy.
The textdraw also shows up for other players but i dont know why cause i used settimerex and textdrawforplayer.
Some help would be great
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:HealthLow;
GetPlayerHealth(playerid,HealthLow);
if(HealthLow < 20)
{
if(lowhactive[playerid] == 1)
{
SetTimerEx("LowHealthFlash1",1000,false,"i",playerid);
lowhactive[playerid] = 0;
}
}
else if(HealthLow > 20)
{
KillTimer(LHFT1);
KillTimer(LHFT2);
KillTimer(LHFT3);
TextDrawHideForPlayer(playerid,wastedlh);
lowhactive[playerid] = 1;
}
}
forward LowHealthFlash1(playerid);
public LowHealthFlash1(playerid)
{
LHFT1 = SetTimerEx("LowHealthFlash2",500,false,"i",playerid);
TextDrawShowForPlayer(playerid,wastedlh);
}
forward LowHealthFlash2(playerid);
public LowHealthFlash2(playerid)
{
LHFT2 = SetTimerEx("LowHealthFlash3",500,false,"i",playerid);
TextDrawHideForPlayer(playerid,wastedlh);
}
forward LowHealthFlash3(playerid);
public LowHealthFlash3(playerid)
{
LHFT3 = SetTimerEx("LowHealthFlash2",500,false,"i",playerid);
TextDrawShowForPlayer(playerid,wastedlh);
}