Custom Healthbar
#2

What's not working about it?

Just out of interest, try this code.
pawn Код:
// Out of callback
new Bar: Life[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    Life[playerid] = CreateProgressBar(547.00, 53.00, 59.50, 8.19, 1735555583, 100.0);
    ShowBarForPlayer(playerid, Life[playerid]);
    new Float: Health;
    GetPlayerHealth(playerid, Health);
    SetProgressBarValue(Life[playerid], Health)
    UpdateProgressBar(Life[playerid], playerid);
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float: Health;
    SetProgressBarValue(Life[playerid], GetPlayerHealth(playerid, Health) - amount);
    UpdateProgressBar(Life[playerid], playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    DestroyProgressBar(Life[playerid]);
    return 1;
}
Reply


Messages In This Thread
Custom Healthbar - by Dynamic - 04.09.2013, 21:41
Re: Custom Healthbar - by Isolated - 04.09.2013, 22:17
Re: Custom Healthbar - by Dynamic - 04.09.2013, 22:57
Re: Custom Healthbar - by Pottus - 04.09.2013, 22:58
Re: Custom Healthbar - by Dynamic - 04.09.2013, 23:11
Re: Custom Healthbar - by Pottus - 04.09.2013, 23:16

Forum Jump:


Users browsing this thread: 1 Guest(s)