SA-MP Forums Archive
How i make show hp on player header - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How i make show hp on player header (/showthread.php?tid=186482)



How i make show hp on player header - gunnrcrakr - 29.10.2010



I want to make it, How i do ?


Re: How i make show hp on player header - iJumbo - 29.10.2010

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


Re: How i make show hp on player header - iJumbo - 29.10.2010

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


Re: How i make show hp on player header - gunnrcrakr - 29.10.2010

Oh Thank it's work


Re: How i make show hp on player header - iJumbo - 29.10.2010

np D:


Re: How i make show hp on player header - Rafa - 29.10.2010

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