SA-MP Forums Archive
ProgressBar Armour color - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ProgressBar Armour color (/showthread.php?tid=581155)



ProgressBar Armour color - RakeDW - 11.07.2015

How to create armour color with using progress bar?
I made 1 but it's bugging my script...



Re : ProgressBar Armour color - KillerDVX - 11.07.2015

Why wouldn't you make one with a textdraw creator ? ^^

use these :

https://sampforum.blast.hk/showthread.php?tid=543002

https://sampforum.blast.hk/showthread.php?tid=376758

https://sampforum.blast.hk/showthread.php?tid=290636

Good luck.




Re: ProgressBar Armour color - RakeDW - 11.07.2015

I know how to make Progress bar but when I make it it bug my script...
So please can anyone help how to make it but without bugs



Re: ProgressBar Armour color - Sime30 - 11.07.2015

Show us your codes how you made it. Maybe we can make it better by editing your bar


Re: ProgressBar Armour color - RakeDW - 11.07.2015

Код:
#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;
}



Re : ProgressBar Armour color - KillerDVX - 12.07.2015

Try this out :

PHP код:
public OnPlayerUpdate(playerid)
{
    new 
Float:ArmourBarInfo;
    
GetPlayerArmour(playeridArmourBarInfo);
        
UpdateProgressBar(ArmourBarInfo[playerid], playerid); //Added
    
if(ArmourBarInfo == 0) { HideProgressBarForPlayer(playeridArmourBar[playerid]); }
    else { 
ShowProgressBarForPlayer(playeridArmourBar[playerid]); SetProgressBarValue(ArmourBar[playerid], ArmourBarInfo); }
    return 
1;




Re: ProgressBar Armour color - RakeDW - 12.07.2015

Thanks Man