12.03.2015, 16:14
(
Last edited by Nabster; 12/03/2015 at 04:55 PM.
)
Code:
CMD:bar(playerid,params[]) { SendClientMessage(playerid,COLOR_PINK,"Progress bar activated"); Bar = CreatePlayerProgressBar(playerid, 375.879943, 160.166656, 100.0, 15.0, COLOR_GREEN, 100.0, BAR_DIRECTION_RIGHT); SetTimerEx("CountBar", 1000, true, "i", playerid); ShowPlayerProgressBar(playerid,Bar); return 1; } CMD:hbar(playerid,params[]) { SendClientMessage(playerid,COLOR_PINK,"Health bar activated"); HealthBar = CreatePlayerProgressBar(playerid, 375.879943, 160.166656, 100.0, 15.0, COLOR_LIMEGREEN, 100.0, BAR_DIRECTION_RIGHT); SetTimerEx("HBUpdate", 1000, true, "i", playerid); ShowPlayerProgressBar(playerid,HealthBar); return 1; } forward CountBar(playerid); public CountBar(playerid) { new Float:BarCount; SetPlayerProgressBarValue(playerid, Bar, BarCount); SetPlayerProgressBarColour(playerid, Bar, COLOR_RED); BarCount++; return 1; } forward HBUpdate(playerid); public HBUpdate(playerid) { GetPlayerHealth(playerid,health); SetPlayerProgressBarValue(playerid, HealthBar, health); SetPlayerProgressBarColour(playerid, HealthBar, COLOR_RED); return 1; }