Error in ENUM
#1

hi all i made an enum, but i got this error.
pawn Код:
new VehicleInfo [] [vInfo] =
{
    {411, "Infernus", 1, 3, 1}, // ERROR LINE. i just added this for checking.
    {531, "Tractor", 123, 126, 125}
};
ErrorCode: error 018: initialization data exceeds declared size

i havent declared any size, but only this ENUM.

pawn Код:
enum vInfo
{
    CarId,
    CarName,
    SpeedRank,
    AccelerationRank,
    OverallRank
};
Reply
#2

You're trying to insert a string into an integer! (Carname -> "Infernus"), so carname has to be a string array.
Reply
#3

pawn Код:
enum
{
    CarName[20]
}
Like what Rajat said, CarName is a string, so you need to add the string in your enum.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)