invalid subscript (not an array or too many subscripts): "asicerik"
#1

Hi .. I have these errors and I dont really understand why .

rp.pwn(9560) : error 028: invalid subscript (not an array or too many subscripts): "asicerik"
rp.pwn(9560) : warning 215: expression has no effect
rp.pwn(9560) : error 001: expected token: ";", but found "]"
rp.pwn(9560) : error 029: invalid expression, assumed zero
rp.pwn(9560) : fatal error 107: too many error messages on one line

pawn Код:
case GRAFITI_DIALOG1:
        {
            switch(listitem)
            {
                case 0:
                {
                    if(response)
                    {
                        Graffiti[playerid][active_character[playerid]][asicerik] == inputtext; // line 9560
                        ShowPlayerDialog(playerid, GRAFITI_DIALOG2, DIALOG_STYLE_LIST, "Graffiti", "Culoare\nDimensiune\nTip(arial vs.)\nOlus,tip", "Okay", "Cancel");
                    }
                }
            }
        }
Graffiti enum :

pawn Код:
enum grafInfo
{
Grafid,
Owner,
Float:aX,
Float:aY,
Float:aZ,
Float:bX,
Float:bY,
Float:bZ,
gType,
Size1,
Color,
asicerik,
};

new Graffiti[MAX_GRAFFITI][grafInfo];
Anyone has any idea?
Reply
#2

If asicerik should be an integer, then it'd be:
pawn Код:
Graffiti[GRAFFITI_ID_HERE][asicerik] == strval(inputtext);
Else if it should be a string, then it'd be:
pawn Код:
strcat((Graffiti[GRAFFITI_ID_HERE][asicerik][0] = '\0', Graffiti[GRAFFITI_ID_HERE][asicerik]), inputtext, SIZE_HERE);
and in the enum:
pawn Код:
asicerik[SIZE_HERE]
Of course, GRAFFITI_ID_HERE and SIZE_HERE should be modified.
Reply
#3

Thanks,I'll try it and let you know.
Reply
#4

I took your advice with the "strcat" function and now it returns three of these erorrs :

error 029: invalid expression, assumed zero

code :

pawn Код:
strcat(([playerid][active_character[playerid]][asicerik][0] = '\0', Graffiti[playerid][active_character[playerid]][asicerik]), inputtext, 128);
Reply
#5

You forgot "Graffiti" before [playerid].

pawn Код:
strcat((Graffiti[playerid][active_character[playerid]][asicerik][0] = '\0', Graffiti[playerid][active_character[playerid]][asicerik]), inputtext, 128);
A way easier would be to use macro for it:
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
and the usage:
pawn Код:
strcpy(Graffiti[playerid][active_character[playerid]][asicerik], inputtext, 128);
Note that the array should be declared:
pawn Код:
new Graffiti[MAX_PLAYERS][MAX_GRAFFITI][grafInfo];
since you have one more index (playerid).
Reply
#6

Damn me, I forgot Graffiti there hehe...

Anyways,tried it and now it shows me

pawn Код:
warning 213: tag mismatch
 error 001: expected token: ")", but found "["
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
 fatal error 107: too many error messages on one line
LE : Redeclaring that variable with MAX_PLAYERS seemed th change what errors I receive. Let me try to fix most of them and I'll come back with a reply if I encounter the same one as above.
Reply
#7

Post the code and comment the errors/warnings on them.
Reply
#8

Now I get these.

error 035: argument type mismatch (argument 2)
error 035: argument type mismatch (argument 4)

On this line :
pawn Код:
CreateObject(19482, Graffiti[grafid][aX], Graffiti[grafid][aY], Graffiti[grafid][aZ], 0.0, 96.0);
Reply
#9

Bump .. anyone has any idea?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)