Warnings
#1

pawn Код:
if(zones[current_zone][zone_name] == zones[162][zone_name])
        {
            if(JHBurgerShotRobbedRecently >= 1)
            {
                SendClientMessage(playerid,COLOR_ERROR,"The Juniper Hollow Burger Shot has been robbed recently.");
                return 1;
            }
            if(rrand <= 30)
            {
                SendClientMessage(playerid,COLOR_ERROR,"Juniper Hollow Burger Shot robbery failed.");
                JHBurgerShotRobbedRecently =320;
                return 1;
            }
            JHBurgerShotRobbedRecently =320;
            RobbingJHBurgerShot[playerid] =25;
            IncreaseWantedLevel(playerid,4);
            IncreasePlayerScore(playerid,1);
LINE 9317   SetProgressBarValue(playerid,RobbingJHBurgerShot[playerid]);
LINE 9318   ShowProgressBarForPlayer(playerid,RobbingJHBurgerShot[playerid]);

            format(string,sizeof(string),"~p~~n~~n~~n~~n~Robbing JuniperHollow BurgerShot.~n~~r~Finish Robbery in: %d seconds.",RobbingJHBurgerShot[playerid]);
            GameTextForPlayer(playerid,string,3000,3);

            format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Juniper Hollow Burger Shot! Get To Burger Shot and arrest the suspect.",PlayerName(playerid),playerid);
            SendClientMessageToAllCops(string);

            format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_RED,string);

            format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
            IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
            return 1;
        }
Warnings :
pawn Код:
C:\Users\Bing\Desktop\Started\gamemodes\process.pwn(9317) : warning 213: tag mismatch
C:\Users\Bing\Desktop\Started\gamemodes\process.pwn(9318) : warning 213: tag mismatch
Why do I get these warnings? How can I fix them?
Hope someone would help me,
Thanks.
Reply
#2

You don't need to use playerid to set a value for progressbar.

You need to use SetProgressBarValue(RobbingJHBurgerShot[playerid], value here); .

For more info about the progressbar, visit this thread: https://sampforum.blast.hk/showthread.php?tid=113443
Reply
#3

Quote:
Originally Posted by iOxide
Посмотреть сообщение
You don't need to use playerid to set a value for progressbar.

You need to use SetProgressBarValue(RobbingJHBurgerShot[playerid], value here); .
As you can see that robbing code, There will be a random timer. It will choose a random time.
pawn Код:
RobbingJHBurgerShot[playerid] =25;
            IncreaseWantedLevel(playerid,4);
            IncreasePlayerScore(playerid,1);
                                      SetProgressBarValue(RobbingJHBurgerShot[playerid]
            ShowProgressBarForPlayer(RobbingJHBurgerShot[playerid]);

            format(string,sizeof(string),"~p~~n~~n~~n~~n~Robbing JuniperHollow BurgerShot.~n~~r~Finish Robbery in: %d seconds.",RobbingJHBurgerShot[playerid]);
            GameTextForPlayer(playerid,string,3000,3);
Here, RobbingGarciaBurgerShot[playerid] =25; means a random timer on my script.
When I tried to use SetProgressBarValue(RobbingJHBurgerShot[playerid]);
Errors & Warnings :
pawn Код:
C:\Users\Bing\Desktop\Started\gamemodes\process.pwn(9284 -- 9285) : warning 213: tag mismatch
C:\Users\Bing\Desktop\Started\gamemodes\process.pwn(9284 -- 9285) : error 001: expected token: ",", but found "-identifier-"
C:\Users\Bing\Desktop\Started\gamemodes\process.pwn(9285) : warning 202: number of arguments does not match definition
Replies are appreciated.
Reply
#4

Then try using SetProgressBarValue(RobbingGarciaBurgerShot[playerid], 25); instead of using RobbingGarciaBurgerShot[playerid] =25; to avoid the warnings. There should be a correct syntax for progressbar to be working fine. Else it will give an error for sure.
Reply
#5

pawn Код:
new Bar:RobbingJHBurgerShot[MAX_PLAYERS];
pawn Код:
SetProgressBarValue(RobbingJHBurgerShot[playerid], 25);
ShowProgressBarForPlayer(playerid, RobbingJHBurgerShot[playerid]);
RobbingJHBurgerShot should store the barid for each playerid.
Reply
#6

Konstantinos, Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)