11.07.2015, 00:50
How to create armour color with using progress bar?
I made 1 but it's bugging my script...
I made 1 but it's bugging my script...
#include <a_samp>
#include <progress>
new Bar:ArmourBar[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
public OnGameModeInit()
{
//new PlayerBar:ArmourBar[playerid] = CreateProgressBar(549.00, 47.00, 55.50, 3.20, 65480, 100.0);
// KreirajPBar(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
KreirajPBar(playerid);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:ArmourBarInfo;
GetPlayerArmour(playerid, ArmourBarInfo);
if(ArmourBarInfo == 0) { HideProgressBarForPlayer(playerid, ArmourBar[playerid]); }
else { ShowProgressBarForPlayer(playerid, ArmourBar[playerid]); SetProgressBarValue(ArmourBar[playerid], ArmourBarInfo); }
return 1;
}
stock KreirajPBar(playerid)
{
ArmourBar[playerid] = CreateProgressBar(549.00, 47.00, 55.50, 3.20, 65480, 100.0);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:ArmourBarInfo;
GetPlayerArmour(playerid, ArmourBarInfo);
UpdateProgressBar(ArmourBarInfo[playerid], playerid); //Added
if(ArmourBarInfo == 0) { HideProgressBarForPlayer(playerid, ArmourBar[playerid]); }
else { ShowProgressBarForPlayer(playerid, ArmourBar[playerid]); SetProgressBarValue(ArmourBar[playerid], ArmourBarInfo); }
return 1;
}