Compiling problem: "expected token: "*then", but found ")" "
#1

Hi!


I moved some things in a dialog just under to

the response in the dialog instead, but it gave me a lot of errors...

Code:
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1573) : error 001: expected token: "*then", but found ")"
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1573) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1590) : warning 225: unreachable code
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1597) : warning 217: loose indentation
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1623) : warning 217: loose indentation
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1623) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1623) : error 004: function "OnPlayerClickPlayer" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1628) : warning 225: unreachable code
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1628) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1628) : error 004: function "robc" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1634) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1634) : error 004: function "wantedT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1641) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1641) : error 004: function "meat" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1650) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1650) : error 004: function "GolfTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1657) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1657) : error 004: function "PipeTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1665) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1665) : error 004: function "MotelVTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1679) : error 030: compound statement not closed at the end of file (started at line 1514)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Errors.
Before it just were the 2 first error lines but it got worse when
I tired to fix it xD..

Have tired to find the issue for pretty long now, but couldn't find...


Code:


pawn Code:
if(dialogid == DIALOG_SELL)
        {
            if(response) // Button 1
            {
                if listitem == 0)
                {
               
                if(MeatRob[playerid] == 1)
                {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
                }
                else
                {
                    SendClientMessage(playerid, Green, "You don't have any meat to sell");
                }
                return 1;
                }
               
                if(listitem == 1)
                {
                    SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
                }
                return 1;
                }

Edit: Picture added in Attachments (So you have a clue how it looks)...
It changes a bit when you paste the code here.

And also good for the numbers on the right side...
Reply
#2

1)
pawn Code:
if listitem == 0)
2)
pawn Code:
GetPlayerMoney(playerid);
Using the function like that does nothing. It returns the money, so you would either store it and do whatever you want or remove it because it makes no sense.
Reply
#3

Quote:
Originally Posted by Konstantinos
View Post
1)
pawn Code:
if listitem == 0)
2)
pawn Code:
GetPlayerMoney(playerid);
Using the function like that does nothing. It returns the money, so you would either store it and do whatever you want or remove it because it makes no sense.
Okay, I see I had it so it doesn't take money that
the player doesn't have, but maybe it's wrong because learned it when
I were beginner xD...

Anyway:

pawn Code:
if listitem == 0)
What's wrong with that??..

Thanks for your reply!.
Reply
#4

Quote:
Originally Posted by davve95
View Post
Okay,
pawn Code:
if listitem == 0)
What's wrong with that??..
pawn Code:
if(listitem == 0)
You do not open the bracket on the if statement.

If there are more errors/warnings, show us the lines.
Reply
#5

Oh I see!, fixed...

But now I got:

pawn Code:
D:\Davids\Scripting\Server Las Venturas\LV.pwn(1573) : error 001: expected token: "*then", but found ")"
D:\Davids\Scripting\Server Las Venturas\LV.pwn(1573) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas\LV.pwn(1573 -- 1575) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas\LV.pwn(1573 -- 1575) : 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.
Reply
#6

What are lines 1572, 1573, 1574, 1575 and 1576? There's an error around those lines.
Reply
#7

Show us lines 1572 to 1576 please.
Reply
#8

Quote:
Originally Posted by Konstantinos
View Post
Show us lines 1572 to 1576 please.
Just this:

pawn Code:
{  //1572
                if listitem == 0)

                {
                if(MeatRob[playerid] == 1) //1576
It's same as I sent (part of it)..

More lines...

http://forum.sa-mp.com/attachment.ph...7&d=1378319867

Tell if I should post them instead...
Reply
#9

pawn Code:
if(listitem == 0) // ..
pawn Code:
if(dialogid == DIALOG_SELL)
{
    if(response) // Button 1
    {
        if(listitem == 0)
        {

            if(MeatRob[playerid] == 1)
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
            }
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }
You're indentation are bad correct them for a better look at your script.
Reply
#10

Quote:
Originally Posted by davve95
View Post
Just this:

pawn Code:
{  //1572
                if listitem == 0)

                {
                if(MeatRob[playerid] == 1) //1576
pawn Code:
if(listitem==0) // 1572
Now what happens?
Reply
#11

Quote:
Originally Posted by Matnix
Посмотреть сообщение
pawn Код:
if(listitem == 0) // ..
pawn Код:
if(dialogid == DIALOG_SELL)
{
    if(response) // Button 1
    {
        if(listitem == 0)
        {

            if(MeatRob[playerid] == 1)
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
            }
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }
You're indentation are bad correct them for a better look at your script.
I can't fix it better then how it looks here:

http://forum.sa-mp.com/attachment.ph...7&d=1378319867


Isolated: What do you mean?.
Reply
#12

It's like you forgot to actually change it to:
pawn Код:
if(listitem == 0)
like I told you before!

From the picture, it's like missing a bracket before the next dialog id.
pawn Код:
if(dialogid == DIALOG_SELL)
{
    if(response) // Button 1
    {
        if(listitem == 0)
        {
           
            if(MeatRob[playerid] == 1)
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
            }
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
       
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }
} // Do you close this?
Reply
#13

CHANGE.
pawn Код:
if listitem == 0)
TO
pawn Код:
if(listitem == 0)
pawn Код:
if(dialogid == DIALOG_SELL)
{
    if(response) // Button 1
    {
        if(listitem == 0)
        {

            if(MeatRob[playerid] == 1)
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
            }
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }
} // you forgot that one
It's will work normaly.
Reply
#14

Quote:
Originally Posted by Matnix
Посмотреть сообщение
CHANGE.
pawn Код:
if listitem == 0)
TO
pawn Код:
if(listitem == 0)
pawn Код:
if(dialogid == DIALOG_SELL)
{
    if(response) // Button 1
    {
        if(listitem == 0)
        {

            if(MeatRob[playerid] == 1)
            {
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 3000);
                SendClientMessage(playerid, Green, "You sold meet, you got 3000$!");
                MeatRob[playerid]=1;
            }
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }
} // you forgot that one
It's will work normaly.
On the end there I recently saw that on my test script of this..

I tired but it just got worse:

pawn Код:
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1589) : warning 217: loose indentation
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1596) : warning 217: loose indentation
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1622) : warning 217: loose indentation
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1622) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1622) : error 004: function "OnPlayerClickPlayer" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1627) : warning 225: unreachable code
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1627) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1627) : error 004: function "robc" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1633) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1633) : error 004: function "wantedT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1640) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1640) : error 004: function "meat" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1649) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1649) : error 004: function "GolfTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1656) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1656) : error 004: function "PipeTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1664) : error 029: invalid expression, assumed zero
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1664) : error 004: function "MotelVTurfT" is not implemented
D:\Davids\Scripting\Server Las Venturas TDM mix\LV.pwn(1678) : error 030: compound statement not closed at the end of file (started at line 1514)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


15 Errors.
I tired with

"that thing on the end" of the code..

And:

pawn Код:
if(listitem == 0)
Reply
#15

Your braces are set bad in OnDialogResponse. Goto http://codegenerators.pl/indent to indent your code, and see yourself that the braces do not match each other (opened with closed) and you don't close the last brace at the end of OnDialogReponse
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    // code
    return 0;
} // < you forgot it.
Otherwise, if you cannot fix it yourself, then you have to post the OnDialogReponse so we'll be able to fix it for you.
Reply
#16

If you can show use all of OnDialogResponse(...) callback, It's would be nice nah?
Reply
#17

Quote:
Originally Posted by Matnix
Посмотреть сообщение
If you can show use all of OnDialogResponse(...) callback, It's would be nice nah?
Why are you copying other posters?
Reply
#18

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
// Do you close this?
This were the problem, thanks a lot I soloved it!

pawn Код:
}
            else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
        }
        return 1;
    }

Should be


pawn Код:
else
            {
                SendClientMessage(playerid, Green, "You don't have any meat to sell");
            }
            return 1;
            }
            if(listitem == 1)
            {
               SendClientMessage(playerid, Green, "Should display the third altenative (Commands)");
            }
            return 1;
    }
Other wise it will say loose indention.

Thanks a lot guys! .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)