Progressbar
#3

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, 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.
        }
}
Reply


Messages In This Thread
Progressbar - by iThePunisher - 30.03.2014, 20:08
Re: Progressbar - by iThePunisher - 31.03.2014, 12:13
Re: Progressbar - by ZeroTheScyther - 31.03.2014, 15:58
Re: Progressbar - by Unte99 - 31.03.2014, 16:06
Re: Progressbar - by ZeroTheScyther - 31.03.2014, 16:23
Re: Progressbar - by iThePunisher - 31.03.2014, 16:40
Re: Progressbar - by ZeroTheScyther - 31.03.2014, 16:43
Re: Progressbar - by iThePunisher - 31.03.2014, 16:48

Forum Jump:


Users browsing this thread: 3 Guest(s)