Error 008
#1

I wonder if this is a bug or something, because for this:
pawn Код:
new LockPickTime[5] =
{
    {60},
    {120},
    {180},
    {300},
    {600}
};
I'm getting this:
Код:
error 008: must be a constant expression; assumed zero
Reply
#2

Quote:
Originally Posted by Pawn-lang.pdf
Error 008: must be a constant expression; assumed zero

The size of arrays and the parameters of most directives must be
constant values.
Reply
#3

Quote:
Originally Posted by pawn-lang.pdf
Error 008: Must be a constant expression; assumed zero:
The size of arrays and the parameters of most directives must be
constant values.
Edit: Klutty was faster.
Reply
#4

I'm sorry, but what does that mean?
Reply
#5

format(string, sizeof(string), "~w~Picking lock, %d seconds remaining", LockPickTime[VehData[LockLevel][GetClosestCar(playerid)]]);

Wouldn't that work?
Reply
#6

Quote:
Originally Posted by zallomallo
format(string, sizeof(string), "~w~Picking lock, %d seconds remaining", LockPickTime[VehData[LockLevel][GetClosestCar(playerid)]]);

Wouldn't that work?
pawn Код:
format(string, sizeof(string), "~w~Picking lock, %d seconds remaining", LockPickTime[VehData][LockLevel][GetClosestCar(playerid)]]);
Try it before asking
Reply
#7

Well actually the storage system is:

VehData[VehInfo][MAX_VEHICLES];

Sorry, but that code only made more errors, including the first one.
Reply
#8

Actually that didn't fix it. I don't know why I'm getting this error.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)