[Error+Warnings]warning 228: length of initialler exceeds size of the enum field
#1

I've got 2 warnings and one error. I don't know what I did do wrong.
This are the warnings:

Code:
\\(17) : warning 228: length of initialler exceeds size of the enum field
\\(18) : warning 228: length of initialler exceeds size of the enum field
\\(19) : error 008: must be a constant expression; assumed zero
This is my script:

pawn Code:
enum aHouseCar{CarName[24],CarModel,CarCost};
new VHouseCar[aHouseCar] =
{
       {"Landstalker"400,    20000},
       {"Bravura"401,    18000}, // line 17
       {"Sentinel", 405,    17500}, // line 18
       {"Manana",   410,    16000}, // line 19
       {"Infernus", 411,    32000},
       {"Cheetah"415,    30000},
       {"Turismo"451,    35000},
       {"SuperGT"506,    30000},
       {"Bullet",       541,    34000},
       {"Uranus",   558,    27000},
       {"Sultan",   560,    28000},
       {"Elegy",        562,    28000},
};
Can you help me?
Reply
#2

Code:
enum aHouseCar{CarName[24],CarModel,CarCost};
new VHouseCar[12][aHouseCar] =
{
{"Landstalker", 400, 20000},
{"Bravura", 401, 18000}, // line 17
{"Sentinel", 405, 17500}, // line 18
{"Manana", 410, 16000}, // line 19
{"Infernus", 411, 32000},
{"Cheetah", 415, 30000},
{"Turismo", 451, 35000},
{"SuperGT", 506, 30000},
{"Bullet", 541, 34000},
{"Uranus", 558, 27000},
{"Sultan", 560, 28000},
{"Elegy", 562, 28000},
};
I think that will work?
Reply
#3

all lines except 27 work:

pawn Code:
enum aHouseCar{CarName[24],CarModel,CarCost};
new VHouseCar[12][aHouseCar] =
{
{"Landstalker", 400, 20000},
{"Bravura", 401, 18000}, // line 17
{"Sentinel", 405, 17500}, // line 18
{"Manana", 410, 16000}, // line 19
{"Infernus", 411, 32000},
{"Cheetah", 415, 30000},
{"Turismo", 451, 35000},
{"SuperGT", 506, 30000},
{"Bullet", 541, 34000},
{"Uranus", 558, 27000},
{"Sultan", 560, 28000},
{"Elegy", 562, 28000}, // line 27
};
ERROR:

Code:
\\(27) error 018: initialization data exceeds declared size
Reply
#4

Remove the comma on the last line.
Reply
#5

thank you working now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)