How i make show hp on player header
#1



I want to make it, How i do ?
Reply
#2

create a label at player connect... then attack it to player make a timer thath check the hp and use a loop.. tath update every time the label
Reply
#3

EXAMPLE
up under #include <a_samp>
pawn Код:
new Text3D:TestHp[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
TestHp[playerid] = Create3DTextLabel(" ",COLOR,30.0,40.0,50.0,40.0,0);
    Attach3DTextLabelToPlayer(TestHp[playerid], playerid, 0.0, 0.0, 0.9);
OnPlayerDisconnect
pawn Код:
Delete3DTextLabel(TestHp[playerid]);

Timer under ongamemodeinit
pawn Код:
SetTimer("UpdateHp",100,1);
The function
pawn Код:
forward UpdateHp();
public UpdateHp()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        new Float:Health;
        new HealthS[15];
        GetPlayerHealth(playerid,Health);
        format(HealthS, 15, "HP:%d",floatround(Health));
        Update3DTextLabelText(TestHp[playerid],COLOR,HealthS);
    }
}
not tested
Reply
#4

Oh Thank it's work
Reply
#5

np D:
Reply
#6

pawn Код:
format(HealthS, 15, "HP:%d",floatround(Health));
what does mean that 15 ^
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)