SA-MP Forums Archive
Error Problem please help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error Problem please help (/showthread.php?tid=196739)



Error Problem please help - TheArcher - 06.12.2010

Hi guys i've got this errors:

pawn Код:
../gamemodes/OnTimers.pwn(196) : error 002: only a single statement (or expression) can follow each "case"
../gamemodes/OnTimers.pwn(196 -- 198) : error 029: invalid expression, assumed zero
../gamemodes/OnTimers.pwn(198) : error 032: array index out of bounds (variable "PlayerInfo")
../gamemodes/OnTimers.pwn(198) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
on these line is:

pawn Код:
if(PlayerInfo[i][pPizzaTime] > 0)
            {
                if(PlayerInfo[pJobTime][i] == 1)
                {
                    PlayerInfo[i][pPizzaTime]--;
                    format(string, 128, "%d", PlayerInfo[i][pPizzaTime]);
                    GameTextForPlayer(i, string, 4000, 6);
                }
                else if(PlayerInfo[i][pPizzaTime] == 0)
                {
                    if(PlayerInfo[pJobTime][i] == 1)
                    {
                        SendClientMessage(i,COLOR_LIGHTRED,"[FALLITO]: Hai fatto raffredare la pizza.");
                        PlayerInfo[pJobTime][i] = 0;
                        PlayerInfo[playerid][pCheckpoint] = CHECKPOINT_NONE;
                        DisablePlayerCheckpoint(i)
                    }
                }
            }


etc....
Help


Re: Error Problem please help - Mauzen - 06.12.2010

You switched the order of i and pJobTime here: if(PlayerInfo[pJobTime][i] == 1)
And you should put all the stuff after a case ...: in { }:
pawn Код:
case 1:
{
    // all the code here
}



Re: Error Problem please help - TheArcher - 06.12.2010

Thanks man it works now