question about 3d attach
#4

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID// If not self-inflicted
    
{
        new
            
infoString[128],
            
victimName[MAX_PLAYER_NAME],
            
attackerName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridvictimNamesizeof (victimName));
        
GetPlayerName(issueridattackerNamesizeof (attackerName));
        new 
str[30];
        new 
Float:health;
        
        
format(strsizeof(str), "-%.0f HP\n%d HP Left"amountGetPlayerHealth(issueridhealth));
        new 
Text3D:HealthLabel =  Create3DTextLabel(infoString0x00AE00FF0,0020.001);
        
Attach3DTextLabelToPlayer(HealthLabelissuerid0.00.02.0);
    }
    return 
1;

Untested, let me know if problem persists.

EDIT: I saw that this will not delete the 3Dlabel once created so what you can do is; add timer to delete it.
Reply


Messages In This Thread
question about 3d attach - by ivndosos - 06.02.2018, 09:20
Re: question about 3d attach - by PepsiCola23 - 06.02.2018, 09:34
Re: question about 3d attach - by ivndosos - 06.02.2018, 09:37
Re: question about 3d attach - by KayJ - 06.02.2018, 09:48
Re: question about 3d attach - by Sew_Sumi - 06.02.2018, 10:56
Re: question about 3d attach - by solstice_ - 06.02.2018, 14:22
Re: question about 3d attach - by Mugala - 06.02.2018, 19:52

Forum Jump:


Users browsing this thread: 1 Guest(s)