Help error 001: expected token
#1

Anyone can help me to fix this problem....

I want to make Toys Vehicle with Text...
And got some problem error....

pawn Код:
enum pvInfo
{
    pvToy[MAX_OBJECTS_PER_PLAYER],
    pvToyID[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosZ[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotZ[MAX_OBJECTS_PER_PLAYER],
    pvToyColor[MAX_OBJECTS_PER_PLAYER],
    pvToyIndex[MAX_OBJECTS_PER_PLAYER],
    pvToyText[MAX_OBJECTS_PER_PLAYER][128], //This line error (170) i want to make this string enum
    pvToyTextCol[MAX_OBJECTS_PER_PLAYER],
    pvToyTextSize[MAX_OBJECTS_PER_PLAYER],
};
new PlayerVehicleInfo[MAX_PLAYERS+1][MAX_PLAYERVEHICLES][pvInfo];
I get this error on that line...

pawn Код:
D:\NE3CF9~1\GAMEMO~1\Untitled.pwn(170) : error 001: expected token: "}", but found "["
How to fix that?
Reply
#2

Try changing it to this and test:
pawn Код:
enum pvInfo
{
    pvToy[MAX_OBJECTS_PER_PLAYER],
    pvToyID[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosZ[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotZ[MAX_OBJECTS_PER_PLAYER],
    pvToyColor[MAX_OBJECTS_PER_PLAYER],
    pvToyIndex[MAX_OBJECTS_PER_PLAYER],
    pvToyText[MAX_OBJECTS_PER_PLAYER][128];,
    pvToyTextCol[MAX_OBJECTS_PER_PLAYER],
    pvToyTextSize[MAX_OBJECTS_PER_PLAYER],
};
new PlayerVehicleInfo[MAX_PLAYERS+1][MAX_PLAYERTOY][pvInfo];
Reply
#3

Not work..

Get same problem.
Reply
#4

Try this,
pawn Код:
enum pvInfo
{
    pvToy[MAX_OBJECTS_PER_PLAYER],
    pvToyID[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosZ[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotZ[MAX_OBJECTS_PER_PLAYER],
    pvToyColor[MAX_OBJECTS_PER_PLAYER],
    pvToyIndex[MAX_OBJECTS_PER_PLAYER],
    pvToyText[MAX_OBJECTS_PER_PLAYER][128], //This line error (170) i want to make this string enum
    pvToyTextCol[MAX_OBJECTS_PER_PLAYER],
    pvToyTextSize[MAX_OBJECTS_PER_PLAYER]
};
new PlayerVehicleInfo[MAX_PLAYERS+1][MAX_PLAYERVEHICLES][pvInfo];
Reply
#5

pawn Код:
enum pvInfo
{
    pvToy[MAX_OBJECTS_PER_PLAYER],
    pvToyID[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyPosZ[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotX[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotY[MAX_OBJECTS_PER_PLAYER],
    Float:pvToyRotZ[MAX_OBJECTS_PER_PLAYER],
    pvToyColor[MAX_OBJECTS_PER_PLAYER],
    pvToyIndex[MAX_OBJECTS_PER_PLAYER],
    pvToyText[MAX_OBJECTS_PER_PLAYER][128],
    pvToyTextCol[MAX_OBJECTS_PER_PLAYER],
    pvToyTextSize[MAX_OBJECTS_PER_PLAYER]
}
new PlayerVehicleInfo[MAX_PLAYERS+1][MAX_PLAYERTOY][pvInfo];
Reply
#6

Got same problem guys...
Reply
#7

Send us the full error line
Reply
#8

Reason of this problem is this variable

Код:
pvToyText[MAX_OBJECTS_PER_PLAYER][128]
This variable is two dimensional, but others are one dimensional - you can't do that. Solution is deleting [128] but probably your script won't work or it will give more errors, but you have to do something with this - maybe other variable, but not in enum.
Reply
#9

When i use this..

pawn Код:
new pvToyText[128][MAX_PLAYERS+1][MAX_OBJECTS_PER_PLAYER][MAX_PLAYERVEHICLES];
It has other error.
Like this....

pawn Код:
D:\NE3CF9~1\GAMEMO~1\Untitled.pwn(153) : error 053: exceeding maximum number of dimensions
Reply
#10

You must change whole script - as i said, delete this variable from enum (this is solution of your error) and next you must create new variable instead of variable in enum which caused error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)