04.09.2013, 22:17
What's not working about it?
Just out of interest, try this code.
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;
}