error 008: must be a constant expression; assumed zero
#1

Omfg...
Reply
#2

You CANNOT declare array sizes with dynamic variables. You must count all the data and make the array big enough or if you don't know how big it is just use '[]'
Reply
#3

Omfg...
Reply
#4

pawn Код:
new CData[APPROXCARCOUNT][cInfo];
That's how you should declare it.
Reply
#5

Omfg...
Reply
#6

56 and MAX_VEHICLES are both constants, 'carcount' is a variable which isn't a constant. If you declare 'carcount' as a global constant/macro, that should work.
Reply
#7

#define somecount carcount

56+somecount? Or what then?
Reply
#8

No, just set a constant size, i.e: 256.
Reply
#9

Omfg...
Reply
#10

Quote:
Originally Posted by Typhome
Посмотреть сообщение
new CData[256][cInfo];?

Hell no, because carcount is variable(changing).

When some bought car, then it will count carcount +1.
Well you can't change that later so just use MAX_VEHICLES
Reply
#11

Yes, but the problem is you CANNOT specify a DYNAMIC size, therefore you MUST use a constant. The error message even tells you that!
Reply
#12

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
Yes, but the problem is you CANNOT specify a DYNAMIC size, therefore you MUST use a constant. The error message even tells you that!
Now i did understand the problem, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)