SA-MP Forums Archive
how to solve this 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)
+--- Thread: how to solve this error (/showthread.php?tid=647042)



how to solve this error - CodeStyle175 - 28.12.2017

//just an example
new arr[MAX_PLAYERS][50][2];
arr[playerid]={{0,1},{0,2}};

//errors
error 008: must be a constant expression; assumed zero
error 048: array dimensions do not match


Re: how to solve this error - MBilal - 28.12.2017

Код:
As you using.
arr[MAX_PLAYERS][2];

arr[playerid]
should be
arr[playerid][0] = 
arr[playerid][1] =



Re: how to solve this error - ThePhenix - 28.12.2017

If you have something like:

PHP код:
new arr[MAX_PLAYERS][50][2]; 
You can do:

PHP код:
arr[playerid][0][0] = 1//or some other value
arr[playerid][0][1] = 1//or some other value 



Re: how to solve this error - CodeStyle175 - 28.12.2017

but isnt there any other way for doing this, it waisting so many rows


Re: how to solve this error - MBilal - 28.12.2017

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
If you have something like:

PHP код:
new arr[MAX_PLAYERS][50][2]; 
You can do:

PHP код:
arr[playerid][0][0] = 1//or some other value
arr[playerid][0][1] = 1//or some other value 
sory i forget that i think Phenix is right.