Anim Bug + Need help in progress bar
#6

What xVIP3Rx said. Everytime RobberyBar is called, it gets initialized at 0 and then it goes 1. It'll never reach greater value. It should be global and don't forget to reset it too.

pawn Код:
// Let's save few memory:


// global:
new robbingtime[MAX_PLAYERS char];

// OnPlayerConnect:
robbingtime{ playerid } = 0;
pawn Код:
if(RobbingWangCars[i] > 1)  //When player is robbing
{
    RobbingWang[i] --;
    WangRobbedRecently =200;
    robbingtime{ playerid } = 0;
    ShowProgressBarForPlayer(playerid, MyRobberyBar);
    RobbingTime = SetTimerEx("RobberyBar",1000,true,"i",i);
}
pawn Код:
forward RobberyBar(playerid);
public RobberyBar(playerid)
{
    robbingtime{ playerid }++;
    SetProgressBarValue(MyRobberyBar,robbingtime);
    UpdateProgressBar(MyRobberyBar, playerid);
    if(robbingtime{ playerid } == 15)
    {
        robbingtime{ playerid } = 0;
        KillTimer(RobbingTime);
        HideProgressBarForPlayer(playerid,MyRobberyBar);
    }
}
I believe you should use each progress bar per player. MyRobberyBar will update for all.
Reply


Messages In This Thread
Deleted. - by iFiras - 30.11.2013, 13:45
Re: Anim Bug + Need help in progress bar - by xVIP3Rx - 30.11.2013, 13:49
Re: Anim Bug + Need help in progress bar - by Konstantinos - 30.11.2013, 13:50
Deleted. - by iFiras - 30.11.2013, 14:38
Re: Anim Bug + Need help in progress bar - by xVIP3Rx - 30.11.2013, 14:46
Re: Anim Bug + Need help in progress bar - by Konstantinos - 30.11.2013, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)