How i make show hp on player header
#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


Messages In This Thread
How i make show hp on player header - by gunnrcrakr - 29.10.2010, 11:39
Re: How i make show hp on player header - by iJumbo - 29.10.2010, 11:48
Re: How i make show hp on player header - by iJumbo - 29.10.2010, 11:53
Re: How i make show hp on player header - by gunnrcrakr - 29.10.2010, 13:29
Re: How i make show hp on player header - by iJumbo - 29.10.2010, 13:53
Re: How i make show hp on player header - by Rafa - 29.10.2010, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)