SA-MP Forums Archive
Errors - 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)
+--- Thread: Errors (/showthread.php?tid=371176)



Errors - BGMike - 22.08.2012

I made this:
pawn Код:
enum fInfo
{
    Furnitures,
    Furniture[100],
    FurnitureName[100][MAX_PLAYER_NAME], // line 697
}; // line 698

new fur[MAX_PLAYERS][fInfo];

new string[256];

    if(strcmp(cmd, "/command", true) == 0)
    {
        new s[20][MAX_PLAYER_NAME];
        for(new f = 0; f < 20; f++)
        {
            if(fur[playerid][Furniture][f] == 0) { format(s[f],sizeof(s[f]),"Free slot!"); } // line 14804
            else { format(s[f],sizeof(s[f]),"%s",fur[playerid][FurnitureName][f]); }
            strcat(string, s[f], sizeof(s[f]));
        }
        ShowPlayerDialog(playerid,28,DIALOG_STYLE_LIST,"Furnitures:",string,"Select","Exit");
        return 1;
    }
And I got this errors:
Код:
gamemode.pwn(697) : error 001: expected token: "}", but found "["
gamemode.pwn(698) : error 010: invalid function or declaration
gamemode.pwn(14804) : error 001: expected token: "]", but found "-identifier-"
gamemode.pwn(14804) : warning 215: expression has no effect
gamemode.pwn(14804) : error 001: expected token: ";", but found "]"
gamemode.pwn(14804) : error 029: invalid expression, assumed zero
gamemode.pwn(14804) : fatal error 107: too many error messages on one line
Can somebody help me ?


Re: Errors - TaLhA XIV - 22.08.2012

Can you highlight the error lines.


Re: Errors - Glint - 22.08.2012

Try it now
pawn Код:
enum fInfo
{
    Furnitures,
    Furniture[100],
    FurnitureName[100][MAX_PLAYER_NAME] // line 697
} // line 698

new fur[MAX_PLAYERS][fInfo];

new string[256];

    if(strcmp(cmd, "/command", true) == 0)
    {
        new s[20][MAX_PLAYER_NAME];
        for(new f = 0; f < 20; f++)
        {
            if(fur[playerid][Furniture][f] == 0) { format(s[f],sizeof(s[f]),"Free slot!");
            else { format(s[f],sizeof(s[f]),"%s",fur[playerid][FurnitureName][f]);
            strcat(string, s[f], sizeof(s[f]));
        }
        ShowPlayerDialog(playerid,28,DIALOG_STYLE_LIST,"Furnitures:",string,"Select","Exit");
        return 1;
    }



Re: Errors - BGMike - 22.08.2012

TaLhA XIV I already showed the lines.

Lexi' I got 5 errors now:
Код:
gamemode.pwn(697) : error 001: expected token: "}", but found "["
gamemode.pwn(14804) : error 001: expected token: "]", but found "-identifier-"
gamemode.pwn(14804) : warning 215: expression has no effect
gamemode.pwn(14804) : error 001: expected token: ";", but found "]"
gamemode.pwn(14804) : error 029: invalid expression, assumed zero
gamemode.pwn(14804) : fatal error 107: too many error messages on one line



Re: Errors - Glint - 22.08.2012

What about now
pawn Код:
enum fInfo
{
    Furnitures,
    Furniture[100],
    FurnitureName[100]
} // line 698

new fur[MAX_PLAYERS][fInfo];

new string[256];

    if(strcmp(cmd, "/command", true) == 0)
    {
        new s[20][MAX_PLAYER_NAME];
        for(new f = 0; f < 20; f++)
        {
            if(fur[playerid][Furniture][f] == 0)
            {
                format(s[f],sizeof(s[f]),"Free slot!");
            }
            else
            {
                format(s[f],sizeof(s[f]),"%s",fur[playerid][FurnitureName][f]);
            }
            strcat(string, s[f], sizeof(s[f]));
        }
        ShowPlayerDialog(playerid,28,DIALOG_STYLE_LIST,"Furnitures:",string,"Select","Exit");
        return 1;
    }
Tell me if it works or not.