Expecting "]" found ";" Doesn't Make Sense
#1

pawn Code:
enum hVars
{
    Float: hX,
    Float: hY,
    Float: hZ,
    hPrice,
    hOwner[128],
    hName[128]
}
pawn Code:
new hInfo[MAX_HOUSES][hVars];
^ Line 516

Code:
C:\Users\Nate\Dropbox\SAMP 2\gamemodes\nateRP.pwn(516) : error 001: expected token: "]", but found ";"
Why am I getting this error? The line right above 516 is
pawn Code:
new pInfo[MAX_PLAYERS][cVars];
and that doesn't give me any errors.
Reply
#2

pawn Code:
enum hVars
{
    Float: hX,
    Float: hY,
    Float: hZ,
    hPrice,
    hOwner[128],
    hName[128]
};
Not sure but ^ might fix it
Reply
#3

you should look a line above..
and reduce the array size the max player name is 24.
Reply
#4

Quote:
Originally Posted by Mionee
View Post
pawn Code:
enum hVars
{
    Float: hX,
    Float: hY,
    Float: hZ,
    hPrice,
    hOwner[128],
    hName[128]
};
Not sure but ^ might fix it
Yes, that is the fix. You must have a semicolon at the end of an enum.
Reply
#5

Quote:
Originally Posted by Aerotactics
View Post
Yes, that is the fix. You must have a semicolon at the end of an enum.
Quote:
Originally Posted by Mionee
View Post
pawn Code:
enum hVars
{
    Float: hX,
    Float: hY,
    Float: hZ,
    hPrice,
    hOwner[128],
    hName[128]
};
Not sure but ^ might fix it
Same error is occuring, I don't have a semi-colon at the end of any other of my enums and it has always worked fine.
Reply
#6

SOLVED!, I did
pawn Code:
#define MAX_HOUSES 20;
and there isn't supposed to be a ; at the end of that line, so it was putting in
pawn Code:
new hInfo[8;][hVars];
which would really give out that error
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)