This one might be the worst example you could get but I hope it helps you.
pawn Код:
new Bar:Pbar[MAX_PLAYERS]; //naming your bar
new BarProg;
new ProgFill[MAX_PLAYERS]; //We'll use this to update the progress bars
forward ProgFill(playerid);// I still don't know what's this doing xD
public OnPlayerConnect(playerid)
{
Pbar[playerid] = CreateProgressBar(548.00, 111.00, 56.50, 3.19, 0x0000FFFF, 100.0); // creating it
SetProgressBarValue(Pbar[playerid], 0); // here you set how "filled" it is
SetTimerEx("ProgFill", 1000, 1, "i", playerid); // creating the timer.
return 1;
}
public ProgFill(playerid)
{
UpdateProgressBar(Pbar[playerid], playerid); // updating the bar, If you set a value but don't update you won't the bar won't change.
if(IsPlayerInRangeOfPoint(playerid, 2.0, //your coords)
{
ShowProgressBarForPlayer(playerid, Pbar[playerid]);
BarProg++;
SetProgressBarValue(Pbar[playerid], BarProg); // here you set how "filled" it is
}
if(BarProg == 100)
{
GivePlayerMoney(playerid,GetPlayerMoney+15000); //if the bar is filled giving the player some money.
BarProg = 0; // then reseting it.
}
}