Help with Damage Text Label. [rep]
#3

You have to save players timer id and kill it if they got a damage before the callback of remove get called

PHP код:
new PDamageTimer[MAX_PLAYERS];
public 
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    new 
gString[128];
    
format(gStringsizeof gString"{ff0000}-%.0f",amount);
    if(
_:PlayerDamage[playerid] != -1)
    {
        
Delete3DTextLabel(PlayerDamage[playerid]);
        
PlayerDamage[playerid] = Text3D:-1;
        
KillTimer(PDamageTimer[playerid]);
    }
    
PlayerDamage[playerid] = Create3DTextLabel(gString0xFFFFFFFF0.00.00.07.5, -1);
    
Attach3DTextLabelToPlayer(PlayerDamage[playerid], playerid0.00.00.4);
    
PDamageTimer[playerid] = SetTimerEx("RemoveDamageLabel"3000false"d"playerid);
    return 
1;
}
forward RemoveDamageLabel(playerid);
public 
RemoveDamageLabel(playerid)
{
    
Delete3DTextLabel(PlayerDamage[playerid]);
    
PlayerDamage[playerid] = Text3D:-1;
    return 
1;

also be sure to do that on player connect
PHP код:
PlayerDamage[playerid] = Text3D:-1
Reply


Messages In This Thread
Help with Damage Text Label. [rep] - by Farzam - 29.08.2016, 19:46
Re: Help with Damage Text Label. [rep] - by Shinja - 29.08.2016, 20:01
Re: Help with Damage Text Label. [rep] - by jlalt - 29.08.2016, 20:07
Re: Help with Damage Text Label. [rep] - by Farzam - 29.08.2016, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)