SA-MP Forums Archive
Error 008 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error 008 (/showthread.php?tid=83249)



Error 008 - zallomallo - 23.06.2009

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



Re: Error 008 - Klutty - 23.06.2009

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.



Re: Error 008 - Correlli - 23.06.2009

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.


Re: Error 008 - zallomallo - 23.06.2009

I'm sorry, but what does that mean?


Re: Error 008 - zallomallo - 23.06.2009

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

Wouldn't that work?


Re: Error 008 - Klutty - 23.06.2009

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


Re: Error 008 - zallomallo - 23.06.2009

Well actually the storage system is:

VehData[VehInfo][MAX_VEHICLES];

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


Re: Error 008 - zallomallo - 23.06.2009

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