SA-MP Forums Archive
Array Error - 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: Array Error (/showthread.php?tid=230379)



Array Error - deather - 23.02.2011

Код:
static row = 1;
if(mysql_num_rows()>1) row = mysql_num_rows();
new str[row];
I get error at 'new str[row];'.

Error:
error 008: must be a constant expression; assumed zero
error 009: invalid array size (negative, zero or out of bounds)
error 036: empty statement
fatal error 107: too many error messages on one line


Re: Array Error - MadeMan - 23.02.2011

str size must be constant, for example

pawn Код:
new str[64];



Re: Array Error - armyoftwo - 23.02.2011

I see that you want to create an dynamic array there.
You can't create dynamic arrays in sa-mp


Re: Array Error - deather - 23.02.2011

OMG!, Thanks anyways.