Invalid expressions
#1

Hey, help me fix this, don't understand why I am getting these errors.

errors :

Код:
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26264) : warning 217: loose indentation
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26271) : warning 217: loose indentation
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26271) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26272) : warning 217: loose indentation
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26292) : warning 217: loose indentation
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26297) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26325) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\Desktop\London Roleplay\gamemodes\gf.pwn(26350) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
the code :

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 1)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                Kick(playerid);
            }
            if(listitem == 1)
            {
              new listitems[] = "1\tMeta Gaming\n2\tMeat Grinder\n3\tMilking Goats\n4\tMortified Greyhounds";
              SendClientMessage(playerid,COLOR_GREEN,"Correct Answer!");
              ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"What is MG?:",listitems,"Select","Cancel");
            }
            if(listitem == 2)
            {
                SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                Kick(playerid);
            }
            if(listitem == 3)
            {
                SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                Kick(playerid);
            }
        }
    }
    if(dialogid == 2) // 26264
        {
            if(response)
            {
                if(listitem == 0)
                {
                  new listitems[] = "1\tOut Of Click\n2\tOunce of Clay\n3\tOut Of Character\n4\tOlly Of Cows";
            `     SendClientMessage(playerid,COLOR_GREEN,"Correct Answer!"); // 26271
                  ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"What is OOC?:",listitems,"Select","Cancel"); // 26272
                }
                if(listitem == 1)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 2)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 3)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
            }
        }

        if(dialogid == 3) // 26292
        {
            if(response)
            {
                if(listitem == 0
                { // 26297
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 1)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 2)
                {
                    new listitems[] = "1\tIn Cook\n2\tIodine Cookery\n3\tIn Character\n4\tIP Cracking";
                    SendClientMessage(playerid,COLOR_GREEN,"Correct Answer!");
                    ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"What is IC?:",listitems,"Select","Cancel");
                }
                if(listitem == 3)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
            }
        }

        if(dialogid == 4)
        {
            if(response)
            {
                if(listitem == 0
                { // 26325
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 1)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
                if(listitem == 2)
                {
                    SendClientMessage(playerid,COLOR_GREEN,"Correct Answer!");
                    TutTime[playerid] = 0; PlayerInfo[playerid][pTut] = 1;
                    gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
                    TogglePlayerControllable(playerid, 1);
                    MedicBill[playerid] = 0;
                    SetPlayerSpawn(playerid);
                }
                if(listitem == 3)
                {
                    SendClientMessage(playerid,COLOR_RED,"Wrong Answer, You have been kicked");
                    Kick(playerid);
                }
            }
        }
    return 1; //26350
}
Reply
#2

Loose indentation means you didnt indent your lines properly, so hit the back space where the error occurs and indent the lines until the error dissapears.

Second show us what line(s) the other errors occur at.
Reply
#3

I know what loose indentations are, I wonna know how to fix the errors. I have marked the lines of the errors on there.
Reply
#4

Oh... Here we go again.

1) Your indentation is horrible, learn to indent better or you will never succeed in scripting.

2) Obviously, you haven't looked at your code. I see 3 obvious mistakes, should I point them out to you?
Reply
#5

Код:
new listitems[64] = "1\tOut Of Click\n2\tOunce of Clay\n3\tOut Of Character\n4\tOlly Of Cows"; //26270

if(listitem == 0)
                { // 26297
and

if(listitem == 0)
                { // 26325
change the line to what i put here
Reply
#6

Sorry, it was late at night and I was tired, found the error straight away in the morning today though lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)