Constant expression?
#1

Hello.
I've made a few things in my script and now I've got an error in the following code:
Код:
new hauskosten[49] =
{
	{2500},	{1700},	{2500},	{2000},	{2500},	{2200},	{1800},	{4500},	{2200},	{2000},	{1500},	{2000},	{2500},
	{2800},	{2500},	{2000},	{2600},	{3000},	{3200},	{2200},	{2400},	{2600},	{1800},	{2000},	{2300},	{1600},
	{3200},	{3100},	{3600},	{3500}, {3100},	{3000},	{3400},	{3000},	{1800},	{2000},	{2300},	{1600},	{3200},
	{3200},	{1200},	{1200},	{1200},	{1200},	{3400},	{3400},	{3400},	{3100}
};
There error is in the first constant, {2500} and is telling me "error 008: must be a constant expression; assumed zero".

I hope you can help
Padarom
Reply
#2

pawn Код:
new hauskosten[49][1] =
{
    {2500}, {1700}, {2500}, {2000}, {2500}, {2200}, {1800}, {4500}, {2200}, {2000}, {1500}, {2000}, {2500},
    {2800}, {2500}, {2000}, {2600}, {3000}, {3200}, {2200}, {2400}, {2600}, {1800}, {2000}, {2300}, {1600},
    {3200}, {3100}, {3600}, {3500}, {3100}, {3000}, {3400}, {3000}, {1800}, {2000}, {2300}, {1600}, {3200},
    {3200}, {1200}, {1200}, {1200}, {1200}, {3400}, {3400}, {3400}, {3100}
};
or

pawn Код:
new hauskosten[49] =
{
    2500,   1700,   2500,   2000,   2500,   2200,   1800,   4500,   2200,   2000,   1500,   2000,   2500,
    2800,   2500,   2000,   2600,   3000,   3200,   2200,   2400,   2600,   1800,   2000,   2300,   1600,
    3200,   3100,   3600,   3500,   3100,   3000,   3400,   3000,   1800,   2000,   2300,   1600,   3200,
    3200,   1200,   1200,   1200,   1200,   3400,   3400,   3400,   3100
};
Reply
#3

thank you, it works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)